Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Team Foundation Service Fatal when git push

I have added Source Control (git) to my project. I have also created a project at Team Foundation Service with git. The project at Team Foundation Service is connected to my Visual Studio. I have Enabled alternate credentials. References Ref1 and Ref 2

When i run;

git remote add origin https://yourname.visualstudio.com/DefaultCollection/_git/ProjectName

Then:

git push origin master

I get this:

Username for 'https://yourname.visualstudio.com':`

After i enter username:

Password for 'https://[email protected]@yourname.visualstudio.com':

After i enter password:

fatal: https://yourname.visualstudio.com/DefaultCollection/ProjectName/info/refs not found: did you run git update-server-info on the server?

I can't seem to find a solution to this, how could i make this a success?

like image 399
Komengem Avatar asked Apr 26 '13 09:04

Komengem


1 Answers

You could try to clone the TFS Git repo, and add your source in it, rather than trying to create the repo locally, and trying to add a remote.

The git clone would setup the (hopefully) right remote, and should let you push back whatever code you would have added and committed.


Johan Leino points out in the comments to "SourceTree + TFS Service + HTTPS: Login failed"

I set up a free TFS account to test this and can reproduce the problem.
I can also reproduce it using the standard install of Git from http://git-scm.com - it appears that out of the box, TFS won't work with standard Git.

However you can make it work by allowing 'Alternative Authentication Credentials' in TFS.

  1. Click on your username in the top-right and select 'My Profile'
  2. Select the 'Credentials' tab
  3. Click 'Enable Alternative Credentials'
  4. Click 'Set' next to the secondary user name and pick a username without an '@' character
  5. Set a password

4 and 5 seem to be optional, but I did it anyway.
Once I did this, I could clone from TFS using either my full email as a user name or the alternative user name I'd created.

It seems like the default TFS authentication is some kind of custom system that only works with the VS tools, and just enabling this alternative authentication makes it work with other systems (why isn't this the default, Microsoft?)

like image 55
VonC Avatar answered Sep 27 '22 18:09

VonC