Reputation: 11983
After updating domain password, accessing git-repo is no longer possible. VS Code and Source Tree as well as Visual Studio are returning the following error message on pull, push, fetch etc..
fatal: Authentication failed
Normally a credentials pop-up should appear however this is not happening. Also the common recommendation is not working:
git config --global credential.helper wincred
Upvotes: 94
Views: 136665
Reputation: 1435
I got fatal: Authentication failed for 'https://github.com/test/my_test_project.git/'
error when I used git commands in Microsoft OneDrive folder. After using git commands in a folder which was not connected to OneDrive, I did not get that error.
Upvotes: 0
Reputation: 506
Honestly, what worked for me was installing the latest version of Git (2.36.1) to the day of this comment.
Happened the same: it stoped working after I changed the AD password. But it seems to be a bug in older releases.
This was a tip that Azure DevOps gave:
Upvotes: -1
Reputation: 1
I was having the same problem and the best solution would be to insert whenever putting " git clone https://@praat.scm.azurewebsites.net:443/.git " [Insert after http:// your username and @ ] and the cloning will work.
Upvotes: -2
Reputation: 2572
Try to manually remove setting
credential.helper=wincred
from
C:\Users\<YOUR LOGIN>\.gitconfig
file it it's there.
For me it helped after password change in LDAP
.
Command to change setting didn't helped.
Upvotes: 0
Reputation: 8571
Using Git for Windows (2.30.0), with the cross platform credential manager, with the remote set as a https GitHub address, to a public repository, doing git push
by itself wasn't sufficient.
Instead I had to explicitly do git push origin main
(replace main
with master
, or whatever your branch is) to have Git for Windows load a GitHub authentication page where I could authorize the application.
Creating a personal access token, as noted in another answer, was not necessary. Windows credentials were not present in Windows Credential Manager, but were added as Generic Windows Credentials via this method.
Upvotes: 1
Reputation: 1200
I have experience a similar issue with Windows 10 and here's how I have solved it:
Open Credential Manager, and navigate to Windows Credential Tab:
You should see an entry for git credentials in Windows Credential Manager:
Here is the root cause, this git credentials is locally cached/saved to your local computer, and since we have changed our Active Directory password, it is currently out of synch.
Note: This is for using git with https only, not for SSH: https://docs.github.com/en/free-pro-team@latest/github/using-git/which-remote-url-should-i-use
Lastly, if you do not have access to Credentials Manager (due to admin/security policy), you can force git to prompt for password by do a git pull from the specific repo by using username based repo url, e.g.
git pull https://{yourgitusername}@{gitrepo}.git
Note that, this is repo specific so you will have to do this each repo.
Good luck.
Upvotes: 20
Reputation: 49
Nothing worked for me, even uninstall git and reinstall. What worked for me was to create a Personal Access Token from your github account and use that as the password. This page will detail the procedures: https://medium.com/@ginnyfahs/github-error-authentication-failed-from-command-line-3a545bfd0ca8
Upvotes: 4
Reputation: 552
The only thing which worked for me was to remove the remote
and add it back. I have tried deleting the credentials and even reinstalling the git the latest version. But the suggested way to access the remotes repos from Github and Microsoft DevOps is by using a shared key.
Upvotes: -1
Reputation: 1878
I faced the same issue and none of the above mentioned solutions did work. Finally I just removed git for windows
and reinstalled the same without any credential managers
. This solved the authentication issue with git.
Upvotes: 1
Reputation: 1422
I had the same issue when Cloning the repository via Bash/VS Code with "fatal:Authentication failed". I used SSH Key authentication instead to connect my repository following the article: [https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops&tabs=current-page][1] I didn't get any errors after with any bash commands!
Above solution works only if your machine can SSH.
Upvotes: 0
Reputation: 17925
I agree with Jesper, Other way to do is - On windows, if you can navigate to :
Control Panel\User Accounts\Credential Manager
Under Windows Credentials\Windows Vault page on Generic Credentials, you can update the password of existing GIT record or can also add new Generic Credentials.
Updated answer for Mac users :
In case if you're here with similar issue on Mac, you can do similar thing in keychain access
- by deleting the existing GIT record, & then if you pass your credentials again in git bash or any other tool a new record gets created, things should work.
Upvotes: 31
Reputation: 1554
Try the following:
Upvotes: 20
Reputation: 11983
The password is stored in windows credential manager and needs to be updated. Open command prompt and enter the following command to view the list of stored passwords:
rundll32.exe keymgr.dll,KRShowKeyMgr
Scroll down in the list until you spot the git-related entries. Click it and edit the correct password.
Voilà!
Upvotes: 206