Cloning into 'project_name'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://my_user_name@example.com/my_user_name/project_name.git/'
How to fix it?
–
–
–
Im my case i was using Git Credential Manager for Windows (it was installed by default, I didn't install it manually)
Credentials Manager had saved my old password but i changed it lately.
If you are in the same conditions, to solve this problem:
Go to Control Panel -> Credentials Manager and delete git account.
After that it will ask you again for the credentials.
No error, but still got access denied error while git pulling.
Then went to Control Panel -> Credentials Manager > Windows Credential and deleted git account.
After that when I tried git pull again, it asked for the credentials and a new git account added in Credentails manager.
–
i coped with same error and my suggestion are:
Start with try build another user in git lab
Recheck username & password (although it sounds obvious)
Validate the windows credential (start -> "cred")
Copy & paste same URL like you get from git lab, the struct should be:
http://{srvName}/{userInGitLab}/{Repository.git}
no '/' at the end
Recheck the authorization in GitLab
Give an attention to case sensitive
Hope one of the above will solve it.
–
If username and password is prompted. Just add Gitlab username and password for clone.
For pop up dialog asking credential, follow the steps below.
Go to "control panel"
user accounts
manage credentials
windows credentials
git:https://username@gitlab.com
click on down arrow
Click remove.
Hope this helps!
This can happen also because of a change in the password and since Git Credential Manager caches it, so if that's the case
1. Open Credential Manager in Windows
2. Search for your GIT credential and reset it to the new password.
Go to your Credential manager => git credentials
Check your git credentials and check your password.
This worked for me.
Generate an access token with never expire date, and select all the options available.
Remove the existing SSH keys.
Clone the repo with the https instead of ssh.
Use the username but use the generated access token instead of password.
alternatively you can set remote to http by using this command in the existing repo, and use this command git remote set-url origin https://gitlab.com/[username]/[repo-name].git
vscode terminal was unable to pull/push
returned this error
remote: HTTP Basic: Access denied
fatal: Authentication failed for
Simply opened regular terminal in the folder location
git pull/push
worked properly
Before digging into the solution lets first see why this happens.
Before any transaction with git that your machine does git checks for your authentication which can be done using
An SSH key token present in your machine and shared with git-repo(most preferred)
Using your username/password (mostly used)
Why did this happen
In simple words, this happened because the credentials stored in your machine are not authentic i.e.there are chances that your password stored in the machine has changed from whats there in git therefore
Solution
Head towards, control panel and search for Credential Manager look for your use git url and change the creds.
There you go this works with mostly every that windows keep track off
I use VS Code on my mac OS and GitLab for my project. I tried so many ways but it worked simply for me by resetting the remote origin of your project repository with the below command:
cd <local-project-repo-on-machine>
git remote set-url <remote-name> <remote-url>
for ex: git remote set-url origin https://<project-repository>.git
Hope it helps someone.
macosgitgitlabauthentication
The updating of the password in the windows credential manager was not the solution for me.
I had to set a different remote url, by:
git remote set-url origin https://gitlab....git
The url in this case was the one that could be found in Gitlab under Clone -> Clone with HTTPS. It was not the one in the command line instructions.
Try if it works on the Git Bash
Have you added a ssh key to your account? If yes remove it and try
again. If not add one and try the ssh url.
You don't necessarily need Tortoise Git but it may also work around
your problem
Try to re-install Git without the Git Credential Manager for Windows
When you've fixed the push problem you will also be able to clone it when it is private or internal.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.