Skip to content

Instantly share code, notes, and snippets.

@jsheridanwells
Last active September 6, 2018 15:21
Show Gist options
  • Save jsheridanwells/75ca6430f11dead13e264763aeb572d9 to your computer and use it in GitHub Desktop.
Save jsheridanwells/75ca6430f11dead13e264763aeb572d9 to your computer and use it in GitHub Desktop.
Cloning a VSTS Repo into Sourcetree

Cloning a VSTS Repo Into Sourcetree

  1. 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.
  1. Go to the repo you want to clone. Navigate to Code, then click the Clone button in the right-hand corner. Copy the HTTPS URL.

  2. 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>
  1. While the cursor is still focused in the input, press TAB. Sourcetree should populate other fields below with info from the remote repo.

References:

How to Setup a Visual Studio Online (VSO) Git Repo in SourceTree (2016)

MSDN VSTS Auth Overview (Updates)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment