I want to use the git command line tools with the Microsoft Team Foundation Server Git repositories.
But every time I want to access to remote repos the authentication fails. And of course I am using Active Directory (this is a TFS server). The git repo management works perfectly from Visual Studio. (even push, sync, clone, etc).
Cloning into 'blabla'
fatal: Authentication failed for 'http://server:8080/tfs/BlaCollection/_git/blabla/'
I have intented using this patters and always fail.
- DOMAIN\username
- username@domainforest
Anyone has get connected using command line tools to a TFS with git server? In my company we use tokens to log on Windows, may be the reason?
I did two things to make it work. Try below.
This is what did it for me. I just opened the Windows Credential Manager as stated above and edited the credentials because some how it was stuck to my previous password.
For myself, I went to Control Panel > Credential Manager > Windows Credentials.
I tried to delete only the Generic Credentials with git: in front of them, but the git commands still didn't work.
After I deleted the Windows Credentials for the TFS server, then the git commands started to work.
Did you change your AD password recently ?
Finally a collegue hit the solution and I will post it here:
Use the command:
Of course, replace
[tfs_server]
with your own TFS server host name.When Credential Manager asks for credentials just leave blanks and press OK. (I this way authentication will be performed using Kerberos).
Check here for more information https://github.com/Microsoft/Git-Credential-Manager-for-Windows#q-i-thought-microsoft-was-maintaining-this-why-does-the-gcm-not-work-as-expected-with-tfs
Windows Credentials -> Generic Credentials
Then add a new item with "git:" in front of the http:// i.e.:
git:http://Example.com
add domain\user as user, and password