1
votes

I recently moved a repository from GitHub to Azure DevOps. I'm using two different computers, and had no problems connecting and cloning on the first computer. On the second computer, I am unable to clone the new Azure DevOps repository. I continue to get the following error:

Cloning into 'C:\Data\Repo'... Error encountered while cloning the remote repository: Git failed with a fatal error. Authentication failed for 'https://dev.azure.com/username/repo/_git/repo/'

I've tried clearing out the credentials in Credential Manager, but continue to get the error. For reference, this second computer also has a business account on it, so I'm not sure if there is an issue with the two accounts or not. But, VS is connected to my personal account, and when I'm asked to select an account, I can select my personal account.

1
Try updating to the latest Git Credential Manager Core: github.com/microsoft/Git-Credential-Manager-Corejessehouwing
Unfortunately, that did not work.Harlan

1 Answers

0
votes

You can try out below workarounds:

1,Clearing the cached credentials from Credential Manager. And then try again.

Go to Credential Manager--> Windows Credentials--> Generic Credentials-->Remove all Git related credentials.

2,You can also try reconnect to your azure devops project from Visual studio.

Go to Team Explorer-->Right click your azure devops project and Click remove-->Click Manage Connections to reconnect to your azure git repo.

enter image description here

3, Remove the cached credential in Registry.

Open Registry Editor-->Navigate to Computer\HKEY_CURRENT_USER\Software\Microsoft\VSCommon\14.0\ClientServices\TokenStorage\VisualStudio\VssApp

Remove all the entries inside VssApp.

4, Try cloning your repo in Git bash or Command Prompt. If it works fine using Git bash and Command Prompt. Then above issue might be caused by the git version shipped with Visual studio. You can follow below steps to replace the git shipped with Visual studio with the latest git version:

  • Navigate to C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git --> Remove the Git folder

  • Dowload the latest Git version and Install it to above folder C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git

Or you can try modify your visual studio to use the Git for windows:

  • remove the Git folder in above ..\TeamFoundation\Team Explorer\Git path.
  • Visual studio 2019 installer → modify → single components--> Check Git for windows
  • Install latest git version on your windows and configure the environment path.