简体   繁体   中英

Authentication Fails When Cloning TFS repo with Git

I have always create 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/ '

And that's it - no other details appear at all.

How can I go about resolving this?


I still have no idea what my first steps in resolving this should be, but I also have this information:

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, as Cece - MSFT suggested for the repo I am currently trying (although this is happening for all of them), I can see that I have full permissions (although my screenshot looks quite different):

在此输入图像描述

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.

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

在此输入图像描述

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM