克隆到 ' 克隆远程存储库时遇到错误:Git 因 TFS Visual Studio 2019 致命失败 error.Authentication 失败

Cloning into ' Error encountered while cloning the remote repository: Git failed with a fatal error.Authentication failed for TFS Visual Studio 2019

修复此错误

我找到了解决方法。事实证明,对于某些(但不是全部)安装,RC 安装程序正在安装 git 的预发布版本。您可以通过在 Visual Studio 副本上安装最新版本的 git 来解决此问题(VS2017 不在您的 PATH 中使用 git)。

在此处下载 git 的 32 位版本:https://github.com/git-for-windows/git/releases/download/v2.11.1.windows.1/PortableGit-2.11.1-32-bit.7z.exe

运行 您下载的文件。您会看到一个弹出窗口 window,询问您要将 git 解压到哪里,输入此文件夹:

C:\Program Files (x86)\Microsoft Visual Studio17\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git

这个其他也等着解决。

Remove the TFS related credentials from Credential Manager
In Credential Manager add the new updated Generic Credentials for the TFS account. Generally, this would overwrite the cached credentials.
Close all Visual Studio instances, delete %LOCALAPPDATA%\.IdentityService as you did.
Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation.0\Cache
Clear all the browser caches especially for the stored password
Restart Visual Studio > Team Explorer > Manage Connections to check if the Enter credential dialog popup. Just try this several times. Based on my test the dialog will popup the first time, but if you cancel it, then you have to restart VS to popup it again.
Run Visual Studio as another user:

cd C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE

runas /netonly /user:<account> devenv.exe

Enter the user possword, then Team Explorer > Manage Connections