0

I'm attempting to use git via posh-git and whenever the command prompts me for my username, when I attempt to input it it appends @mycompany.visualstudioonline.com to my username.

My username is "first.last@mycompany.com" so it then appends the doman prompts for the password for "first.last@mycompany.com@mycompany.visualstudioonline.com"

I've tried adding my username to the config file and it still appends the @mycompany.visualstudioonline.com on to my username automagically. Is there any way to stop this?

Thanks.

tear
  • 191
  • 9
EricKitt
  • 39
  • 6

1 Answers1

0

You are being prompted for username and password because:

To avoid having Git each time prompting for username&password you could:

  • if you need to use HTTPS protocol, install the latest Git credential manager (for example for Windows you would find it here on GitHub), Git would then leverage this program to fetch the credentials: you would be prompted once, then each subsequent command you would issue the previously stored credentials will be provided automatically.
  • use SSH protocol instead, and place your public SSH key (you should have created it beforehand inside your $HOME/.ssh) onto the allowed SSH keys of VSTS. Read the VSTS documentation about how to create and upload your keys.

Note: Remember that for any given repository on VSTS you could access it by using either:

  • HTTPS with a remote url like: https://YOURACCOUNT.visualstudio.com/DefaultCollection/YOURTEAMPROJECT/_git/YOURREPONAME
  • SSH with a remote url like: ssh://YOURACCOUNT@YOURACCOUNT.visualstudio.com:22/DefaultCollection/YOURTEAMPROJECT/_git/YOURREPONAME

In a Git repository you can modify the url of the 'origin' remote (or any other remote indeed) at any time by the command:

>git remote set-url origin YOURURL 

where (on VSTS) YOURURL is one of the two shown above.

Luca Cappa
  • 1,925
  • 1
  • 13
  • 23