12
votes

I have always created local repositories using this command:

git clone http://TFSServer:8080/tfs/Scripts/_git/ProjectName

However, when I do it at the moment I get this message:

Cloning into 'ProjectName' ...

fatal: Authentication failed for 'http://TFSServer:8080/tfs/Scripts/_git/ProjectName/'


When starting up Visual Studio Code I see this error:

unable to get local issuer certificate

and when trying to push to TFS from VSCode (which I have always been able to do in the past), I see this error:

Authentication failed on the git remote


After checking the repo permissions, I can see that I have full permissions:

enter image description here

4

4 Answers

42
votes

It turns out that this only started happening after I needed to change Windows logon password.

The password was updated locally and on the TFS server, but not in the cached credentials for git.

Fix

Control Panel -> Credential Manager -> Generic Credentials

Then update the password for git:http://ServerName:1234/

Now I can successfully access the repo from command line and VS Code.

2
votes

Please check the Git repository 'ProjectName' permissions to see whether you have the Read permission, or grant your account the Read permssion:

enter image description here

0
votes

In my case the issue was resolved changing settings in Visual Studio. I got the instructions from this post on Microsoft's Developer Community.

Git Clone from TFS: Authentication error

Depending on what kind of secure channel are you using to connect to your repo the solution for this issue could be different. In my case I'm using OpenSSL and the steps to fix the problem are ase follows:

  1. Open Visual Studio.
  2. Click on Team Explorer > Settings > Global Settings
  3. Change the Cryptographic network provider to OpenSSL.
-1
votes

I can almost guarantee you that the URL you're using is wrong.

It should typically be: git clone http://<tfs uri>/tfs/<team project collection name>/<team project name>/_git/<repo name>