Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication Fails When Cloning TFS repo with Git

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

like image 913
Bassie Avatar asked Oct 12 '16 13:10

Bassie


People also ask

Why Git clone is not working?

This error occurs if the default branch of a repository has been deleted on GitHub.com. Detecting this error is simple; Git will warn you when you try to clone the repository: $ git clone https://github.com/USER/REPO.git # Clone a repo > Cloning into 'repo'... > remote: Counting objects: 66179, done. >


2 Answers

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.

like image 182
Bassie Avatar answered Sep 28 '22 19:09

Bassie


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

like image 22
Cece Dong - MSFT Avatar answered Sep 28 '22 20:09

Cece Dong - MSFT