schmendrick
schmendrick

Reputation: 471

Accessing TFS git repository always prompts for username and password from outside of Visual Studio

I have set up a Team Foundation Server 2013 which natively supports git as source control. I have successfully created a project called "TestTeamProject". I set up 2 users for the TFS which are 2 domain users.

Pusing/pulling from Visual Studio 2013 onto that works fine. But when i try to push/pull from the command line or Git Extensions tool, a console window will pop up EVERY TIME asking for username and password with

Username for 'http://myTFS:8080':
Password for 'http://example-username@myTFS:8080':

i tried to set up at least the username in git extensions / git settings, he still promts for both of them.

i have used git before only via ssh where i then can generate a file that gets used for the credentials, but TFS does not support SSH protocol, so is there some way to be able to use TFS with git without needing to enter the credentials all the time when i push/pull from outside visual studio?

git-tfs is not what i am looking for, because we want to use the native git support of TFS.

we need to be able to use git outside of visual studio because not the whole development team is .NET based!

Any ideas what i could do?

Upvotes: 10

Views: 13250

Answers (5)

Darxis
Darxis

Reputation: 1570

A solution for me was to ensure that the Extended Protection in Windows Authentication in IIS was set to "Off". I also got "NTLM" and "Negotiate" as Providers.

Disabling the Extended Protection was the only solution to the problem in my case.Solution

Upvotes: 0

schmendrick
schmendrick

Reputation: 471

I solved the problem myself.

It was not the server but in both the tried clients. On my Win7 64bit machines I had the problem that the path to git-credential-winstore.exe was not found. both the last 2 versions of gitextensions (or is it git that makes the problem?) [version 246 and version 24703] seem to have a problem locating that.

I fixed this by uninstalling gitextensions and installin gitextension and git again, but this time not to C:\Program Files (x86)\ but to C:\Linux\.

Strangely enough the program after installation cried that the paths are not correct (on startup he will show the path to the git.exe pointing to C:\Program Files (x86)\ which I then had to fix manually. But after that all worked!

Upvotes: 0

Edward Thomson
Edward Thomson

Reputation: 78673

Visual Studio should store credentials in the Windows Credential Manager, which is compatible with the Git Credential Winstore. If you install Git Credential Winstore, it should no longer prompt you at the command-line.

Upvotes: 10

knocte
knocte

Reputation: 17939

You can add alternative credentials in your TFS page, i.e.:

https://username.visualstudio.com/_details/security/altcreds

(replace username with the proper value)

Upvotes: 1

pa1geek
pa1geek

Reputation: 268

https://confluence.atlassian.com/display/STASH/Permanently+authenticating+with+Git+repositories

This link has the details how to set up Git credentials for other than windows. I am putting this here in case someone stumbles through this question (like I did)

Upvotes: 1

Related Questions