Getting "fatal: Authentication failed" -error when sending git commands in Windows 10

WindowsGitVisual Studio-CodeAtlassian Sourcetree

Windows Problem Overview


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.

Windows Solutions


Solution 1 - Windows

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à!

Windows 10 - Stored user names and passwords

Solution 2 - Windows

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 - Windows

Try the following:

  1. Click Start
  2. Type: Credential Manager
  3. See the Windows Credential Manager shortcut and double-click it to open the application.
  4. Once the app is open, click on the "Windows Credentials" tab.
  5. Locate the credentials that you want removed, they will start with "git:" and might begin with "ada:"
  6. Click on the credential entry, it will open a detail view of the entry.
  7. Click Remove and confirm removal when prompted.

Solution 4 - Windows

I have experience a similar issue with Windows 10 and here's how I have solved it:

  1. From Windows Search, type Credential Manager:

enter image description here

  1. Open Credential Manager, and navigate to Windows Credential Tab: enter image description here

  2. You should see an entry for git credentials in Windows Credential Manager: enter image description here

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.

  1. Click Edit, and change this to your new/changed Active Directory password (this password has to match your new/changed Active Directory password) : enter image description here

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

  1. 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

enter image description here

Note that, this is repo specific so you will have to do this each repo.

Good luck.

Solution 5 - Windows

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.

Solution 6 - Windows

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

Solution 7 - Windows

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.

Solution 8 - Windows

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://docs.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.

Solution 9 - Windows

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.

Solution 10 - Windows

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: enter image description here

Solution 11 - Windows

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.

Solution 12 - Windows

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJesper WilfingView Question on Stackoverflow
Solution 1 - WindowsJesper WilfingView Answer on Stackoverflow
Solution 2 - Windowswhoami - fakeFaceTrueSoulView Answer on Stackoverflow
Solution 3 - WindowsMitendraView Answer on Stackoverflow
Solution 4 - WindowsMaksoodView Answer on Stackoverflow
Solution 5 - WindowsSiteshView Answer on Stackoverflow
Solution 6 - WindowsTechView Answer on Stackoverflow
Solution 7 - WindowsJames SkempView Answer on Stackoverflow
Solution 8 - WindowsKiran ModiniView Answer on Stackoverflow
Solution 9 - WindowsMaxim KorobovView Answer on Stackoverflow
Solution 10 - WindowsBazilView Answer on Stackoverflow
Solution 11 - WindowsMudasar RaufView Answer on Stackoverflow
Solution 12 - WindowsComputaaGeekView Answer on Stackoverflow