在 Windows 10 中发送 git 命令时出现“致命:身份验证失败”-错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42830318/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting "fatal: Authentication failed" -error when sending git commands in Windows 10
提问by Jesper Wilfing
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..
更新域密码后,无法再访问 git-repo。VS Code 和 Source Tree 以及 Visual Studio 在 pull、push、fetch 等时返回以下错误消息。
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.
...不管用。
回答by Jesper Wilfing
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:
密码存储在 Windows 凭据管理器中,需要更新。打开命令提示符并输入以下命令以查看存储的密码列表:
rundll32.exe keymgr.dll,KRShowKeyMgr
Scroll down in the list until you spot the git-related entries. Click it and edit the correct password.
在列表中向下滚动,直到找到与 git 相关的条目。单击它并编辑正确的密码。
Voilà!
瞧!
回答by whoami
I agree with Jesper, Other way to do is - On windows, if you can navigate to :
我同意 Jesper,其他方法是 - 在windows 上,如果您可以导航到:
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.
在 Generic Credentials 的 Windows Credentials\Windows Vault 页面下,您可以更新现有 GIT 记录的密码,也可以添加新的 Generic Credentials。
Updated answer for Macusers :
Mac用户的更新答案:
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.
如果你在 Mac 上遇到类似问题,你可以做类似的事情keychain access
- 通过删除现有的 GIT 记录,然后如果你在 git bash 或任何其他工具中再次传递你的凭据,就会创建一个新记录,事情应该工作。
回答by Mitendra
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.
- 点击开始
- 类型:凭证管理器
- 查看 Windows 凭据管理器快捷方式并双击它以打开应用程序。
- 打开应用程序后,单击“Windows 凭据”选项卡。
- 找到您要删除的凭据,它们将以“git:”开头,也可能以“ada:”开头
- 单击凭据条目,它将打开条目的详细信息视图。
- 单击删除并在出现提示时确认删除。
回答by Kiran Modini
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!
通过 Bash/VS Code 使用“fatal:Authentication failed”克隆存储库时,我遇到了同样的问题。我使用 SSH 密钥身份验证代替以下文章连接我的存储库:[ https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure -devops&tabs=current-page][1]使用任何 bash 命令后我都没有收到任何错误!
Above solution works only if your machine can SSH.
仅当您的机器可以 SSH 时,上述解决方案才有效。