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

后端 未结 9 1166
孤独总比滥情好
孤独总比滥情好 2021-01-30 01:40

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, pus

相关标签:
9条回答
  • 2021-01-30 02:08

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

    1. From Windows Search, type Credential Manager:

    1. Open Credential Manager, and navigate to Windows Credential Tab:

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

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

    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
    

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

    Good luck.

    0 讨论(0)
  • 2021-01-30 02:16

    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.

    0 讨论(0)
  • 2021-01-30 02:18

    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.

    0 讨论(0)
提交回复
热议问题