- Get personal access token:
- Go to:
https://<YOUR ORGANIZATION NAME>.visualstudio.com/_details/security/tokens
- Click 'Add'
- Fill out description, expiration date, then
Create Token
- Copy and store the token that is generated - VSTS will not show the token again.
-
Go to the repo you want to clone. Navigate to
Code
, then click theClone
button in the right-hand corner. Copy the HTTPS URL. -
In Sourcetree, click Clone. In the
Source Path / URL
input, paste the clone url from VSTS. Add the following fields as follows:
- Original URL :
https://<YOUR TEAM NAME>.visualstudio.com/<YOUR REPO NAME>/_git/<YOUR REPO NAME>
- Modified URL :
https://<YOUR VSTS USERNAME>:<YOUR PERSONAL ACCESS TOKEN>@<YOUR TEAM NAME>.visualstudio.com/<YOUR REPO NAME>/_git/<YOUR REPO NAME>
- While the cursor is still focused in the input, press TAB. Sourcetree should populate other fields below with info from the remote repo.
How to Setup a Visual Studio Online (VSO) Git Repo in SourceTree (2016)
MSDN VSTS Auth Overview (Updates)