4
votes

I try to access my git repository which is hosted on VS Team Services. Works fine in Visual Studio but I need access from the commandline using the standard git client.

When I try to do commands like pull I am asked for my credentials. Now my problem is that my credentials are my MSDN-Account data using my email and a password.

After I entered my email in the git commandline I can see it tries to build a password-url which cannot work because there are two "@"s in the address:

git clone https://myproject.visualstudio.com/DefaultCollection/_git/coderepo
Username for 'https://myproject...':  myself@mydomain.com
Password for 'https://myself@mydomain.com@myproject...' :

After entering my password I receive (not surprisingly) a "fatal: Authentication failed"

So: How do I work with emails as username-credentials in git?

2
Unrelated: You'll be interested about this to avoid entering them every time.tne

2 Answers

1
votes

Found a solution myself.

In VS Team Services, under https://[projectname]mydea.visualstudio.com/_details/security/altcreds

there can be entered "Alternate authentication credentials" with a real username (no email)

alternate credentials VS Team Services

1
votes

You can use alternate credentials or personal access token to access to Team Services Hosted Git repositories.

And a more convenient way would be use Git Credential Manager for Windows. This tool will prompt a Team Services sign in dialog when you need to access to Team Services Git Repository and you just need to enter your Team Services account credentials in it directly.