How can I authenticate to our TFS server in my Git

2019-02-20 14:56发布

问题:

We have a TFS 2017 server setup on our corporate domain. I want to use the Git for Windows CMD line to push and pull code from a repo on that TFS server.

I have added the neccessary certs to my local store in order to pass the SSL hurdle, but now when I try and clone the remote repo down into either my domain joined workstation OR my non-domain laptop, I get the following error:

fatal: Authentication failed for 'https://TFSServer/Collection/ABC/_git/Alarm/

Why doesn't Git prompt me for my credentials?

回答1:

Make sure you don't have a credential helper which might have cached the wrong credentials.

Check git config -l for any credential.helper line.

With recent Git for Windows, you would be using the Microsoft Git Credential Manager, linked to the Credential Manager in Windows



回答2:

First suggest you Use Git Credential Managers to Authenticate to Visual Studio Team Services

When you connect to a TFS Git repository from your Git client for the first time, the credential manager will prompt for your credentials.

Another option is using SSH key authentication

Connect to your Git repos through SSH when you can't use the recommended Git Credential Managers or Personal Access Tokens to securely connect using HTTPS authentication.



标签: git ssl tfs