In this article, we will be going to learn how to connect Azure DevOps Repos with SourceTree.
Sourcetree is a tool that simplifies connecting your Git repositories. Using SourceTree you can visualize and manage your repositories through GUI.
Generate git credentials
For connecting SourceTree, we need credentials of Azure DevOps repo. Follow the steps to generate credentials:
Step 1) Go to your branch
Step 2) Click the clone button
Step 3) Click Generate Git Credentials (we are using https instead of ssh)
Step 4) Copy your username and password and save them somewhere because you won't get it again.
Add Azure DevOps git account to SourceTree
Step 1) Open SourceTree and click on Account.
Step 2) Click Add to attach the new account and then add the following details
|Host||Choose Azure DevOps|
|url||https://[[yourdomain]].visualstudio.com/ Where [[yourdomain]] is your DevOps domain|
|Auth Type||Keep default value|
Clone repo to SourceTree
We have multiple ways to clone the repo. The first method is to clone by adding URL manually. In this method, we clone the repo by providing a repo URL.
Step 1) Open SourceTree and click on new and then select "Clone from URL"
Step 2) Enter the source URL which we get from DevOps
Note: If your cloned URL is in the format of https://<<yourdomain>>@dev.azure.com then use https://<<yourusername>>@dev.azure.com.
It will ask you to provide your username and password to authenticate.
Step 3) After authentication, click clone.
The second method to clone the repo is as follows:
Step 1) Open SourceTree and click on Remote
Step 2) Click clone
Your cloned repo is ready to create a branch, do push, pull and commit.