Getting "fatal: Authentication failed" -error when sending git commands in Windows 10
Solution 1
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à!
Solution 2
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.
Solution 3
Try the following:
- Click Start
- Type: Credential Manager
- See the Windows Credential Manager shortcut and double-click it to open the application.
- Once the app is open, click on the "Windows Credentials" tab.
- Locate the credentials that you want removed, they will start with "git:" and might begin with "ada:"
- Click on the credential entry, it will open a detail view of the entry.
- Click Remove and confirm removal when prompted.
Solution 4
I have experience a similar issue with Windows 10 and here's how I have solved it:
- From Windows Search, type Credential Manager:
-
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.
- Click Edit, and change this to your new/changed Active Directory password (this password has to match your new/changed Active Directory password) :
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
- Save, it should work (does not require terminal or machine restart).
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.
Solution 5
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
Jesper Wilfing
Updated on August 20, 2021Comments
-
Jesper Wilfing over 2 years
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...
git config --global credential.helper wincred
...is not working.
-
Andrey over 5 yearsunlike using Control Panel\User Accounts\Credential Manager like every other answer on the internet suggests, this worked for me
-
iko79 almost 5 yearsWorks for me but for some reason the password is set back to the old one after a few mintues. So I have to perform this every time I want to push. Any ideas why this is?
-
gkonuralp almost 5 yearsI can't open credential manager because of a computer policy. But this command fixed my problem. Many thanks!
-
whoami - fakeFaceTrueSoul over 3 yearsThat's specific to GIT repos on
Azure DevOps
: Check this :: stackoverflow.com/questions/34837173/… -
whoami - fakeFaceTrueSoul over 3 yearsOr if you're having issue while cloning GIT repo hosted on
Azure DevOps
, check this:: stackoverflow.com/questions/34837173/… -
Vitaly Leskiv over 3 yearshelped me on Win 10, but only after deleting entirely
-
Michael Lucas about 3 years@iko79 I found the same behaviour (set back after 1 or 2 commands run). The solution seemed to be to Remove the credential instead of Editing it. Then when I ran the git command next time I was prompted, and that one stuck without getting replaced.
-
oyesil about 3 yearsThis worked for me as well. The other recommendations didn't.
-
Kyle Burkett almost 3 yearsFor users in DevOps, there is an access token instead of a password. Just delete the credential entirely and you will be prompted to login and the new PAT will be stored with appropriate access.
-
despot almost 3 years@iko79 same for me. Mitendra's answer regarding CredentialsManager stackoverflow.com/a/64209332/521754 is a more clean/permanent solution rather then the workaround that Michael Lucas is proposing in the comments. Chose Mitendra's answer as it was the first given on Credentials Manager.
-
Breno almost 3 yearsThis worked for me! After authorizing in the GitHub page, is it then possible to just use
git push
? -
James Skemp almost 3 yearsGlad it helped! Yes, once the longer version has been used and the authorization has been completed a normal
git push
should now work. -
GHH over 2 yearsThanks. You save me a day.
-
essential over 2 yearswhat if i have deleted record from that and it still does not prompt for the credentials?
-
ADJenks over 2 yearsThis is a bit esoteric. Is there somewhere I can open a ticket to suggest that the program just prompt you for a password when it fails the first time? I'm not really sure what part of the credential chain is broken so I don't know where I would make the suggestion.
-
Jeromy French over 2 yearsYou just saved me a day of work.