Why TFS with GIT is not working from command line?

Jairo Andres Velasco Romero picture Jairo Andres Velasco Romero · Jun 9, 2016 · Viewed 20.5k times · Source

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?

Answer

Kirill Chilingarashvili picture Kirill Chilingarashvili · Aug 22, 2017

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