How to connect to GIT repositories in Visual Studio Online with 3rd party tools


Since the release of Visual Studio (Online) with GIT support, I tried to understand GIT and how it works with the tools I have.

Of course I understand Visual Studio and I’m still using Team Foundation Server (TFS) together with Team Explorer. No problem there. Nowadays we have GIT and yes it’s really easy to connect to my Visual Studio Online GIT repository.
(I presume you already connected to a GIT repository with Visual Studio, otherwise check this link from the MSDN documentation.)

But what about the other tools? GIT Bash, SourceTree or even XCode? My first attempt gave me a nice “fatal: Authentication failed for ….” error in SourceTree.

Git Bash Login Error

What is going on? Apparently we need basic authentication enabled to use other 3rd party tools. There are some hints in the MSDN documentation or when you create your first Visual Studio Online project, however most of the time you start with an existing customers project.

Tip: You can get the url of your repository from Visual Studio Online -> project -> code tab -> Clone (paper icon on the right)

So let’s fix this with a few steps:

  1. Go to Visual Studio Online with your browser and login with your own Microsoft account.Visual Studio Online Startpage - after Login
  2. Click on your name (on the right) and a second screen will appear.
    Then click on “My Profile”. You will see a nice pop-up windows.Welcome to Visual Studio Online - Visual Studio Online (1)
  3. Go to the third tab “Credentials” and click on the link “Enable alternate credentials”.Welcome to Visual Studio Online - Visual Studio Online-        -
  4. Now fill in your username and password.  Welcome to Visual Studio Online - Visual Studio Online-        - (1)
  5. Done!! You now can login with your favorite tools!

Example Git Bash:

Example SourceTree:

SourceTree Login Succes

SourceTree Login Succes First SourceTree Login Succes