Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Connect to visualstudio.com hosted GIT repository with sourcetree for Mac

oddjones April 30, 2014

Hi there, My team uses a GIT Repo hosted at visualstudio.com- is there any way I can connect to it using sourcetree for Mac OS X?

5 answers

1 accepted

2 votes
Answer accepted
oddjones May 27, 2014
As it happens I've managed to solve this problem (entirely by luck I hasten to add, no skill involved) I personally had a couple of issues...
Firstly was my GIT config - as I access through a network proxy I had to change Sourcetree to use the command line GIT which I could then configure using the
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy http://proxyuser:proxypwd@proxy.server.com:8080
commands.
I just happened to notice the syntax of the config statements and was able to connect to visualstudio.com's GIT server by stuffing my (secondary) visualstudio.comcredentials in front of the "clone this repo" URL like so:
This works (like a dream!)
Unfortunately, I now have to get around the issue of cloning a repo onto a parallels 9 VM - anybody? :-|
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2014

Thanks for the details, mark yourself as the answer.

I would take the VM question to a Stack Exchange forum, since your barriers are probably going to be with networking, not SourceTree.

10 votes
Matt Strange August 21, 2015

You need to use the personal access token authentication system since you can't do two factor authentication with a normal git login:

  1. From the VS Online website, click your name in the upper right corner
  2. My Profile
  3. Security
  4. Personal access tokens
  5. Add a new token with the name "git"
  6. Copy this password temporarily
  7. Connect Sourcetree using your normal visual studio login and the password you just created

As stated above, you can get the clone URL from VS Online:

  1. Code
  2. Explorer
  3. Click your repo
  4. Click the clone button the right hand side of the screen
  5. Copy the url to clone

 

Radosław Rudnicki March 5, 2019

It is important to use this obtained token as a password when prompted (even several times). No need to include this token in url, but possibly may be used as written in Dominic's answer (as a password)

1 vote
uoc1691 January 3, 2018

Ran in to the same problem myself. To overcome this:

 

1. Use CMD to clone (git clone [url])

2. Open Sourcetree and Add existing repository

phillipsim August 9, 2018

After trying all other solutions this one worked for me. Thank you!

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2014

According to the details, you need to trust the host. Open the terminal, and SSH to the webservices.visualstudio.com. Before it asks you for credentials, it will ask if you want to trust the host key (say yes). After that you can cancel, you don't actually have to log in, or even be able to log in.

oddjones April 30, 2014

Unfortunately visualstudio.comdoesn't seem to accept ssh connections (my terminal ssh sessions just time out unless I'm doing something really stupid, which is very possible!) - is there a simpler way to trust the connection (via a browser perhaps?)

oddjones May 27, 2014

...Anybody?

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2014

Well, I'm glad I don't host anything at visualstudio.com.

See if you can adapt these instructions to your situation (warning, they are for HG, not Git, good luck).

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2014

You may also try cloning via command line. The command line may give you the option to trust the fingerprint.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2014

Yes, the same as you connect to most other repositories (unless Microsoft has munged things up and only supports some proprietary protocol to access it).

http://www.youtube.com/watch?v=fS-o25nS0uk#t=377

oddjones April 30, 2014

Well, of course I tried this basic stuff before I posted the question - here's what happens when you try to clone the repo...

That spinner just sits there...

until (after about 5 mins) you get this...

oddjones April 30, 2014

... (obviously this is a valid URL)

I can access the internet, I can clone repos from github & bitbucket. I can access this git url using the (awful) GitEye application. Any ideas?

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2014

You'd be surprised how many people don't realize you can type into that Source Path / URL box, but think Hosted Repositories are the only options.

I'll post an answer with some ideas about the invalid source path.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2014

What does it say if you click Details?

oddjones April 30, 2014

:-)

he he - well, you did ask!

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2014

Perfect, see answer below.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events