Using Sourcetree

Sep 20, 2020 How to Access GitLab via SourceTree (UPDATED) Method 1: Connect with Remote (Account Profile) Since SourceTree 3.0, it adds support for additional remote hosting services. They are GitHub. Create Personal Access Token. Method 2: Connect with SSH Key. What is SSH Key.

  • Download SourceTree Here: Flowchart Here: this tutorial, i briefly go o.
  • SourceTree is a powerful Git and Mercurial desktop client for developers on Mac or Windows. In this tutorial, we're using OSX 10.9.5 and SourceTree 2.0.4.
  • The key benefit to Sourcetree is the visualization of the Git process. It can feel daunting when you're using the command line, as you have a limited view of what's happening behind the scenes. Managing large projects with mutiple branches, commits and developers can get messy. SourceTree can make the whole process more managable.

Git basics

Git is a free and open source version control system, originally created by Linus Torvalds in 2005. Unlike older centralized version control systems such as SVN and CVS, Git is distributed: every developer has the full history of their code repository locally. This makes the initial clone of the repository slower, but subsequent operations such as commit, blame, diff, merge, and log dramatically faster.

Git also has excellent support for branching, merging, and rewriting repository history, which has lead to many innovative and powerful workflows and tools. Pull requests are one such popular tool that allow teams to collaborate on Git branches and efficiently review each others code. Git is the most widely used version control system in the world today and is considered the modern standard for software development.

How Git works

Here is a basic overview of how Git works:

  1. Create a 'repository' (project) with a git hosting tool (like Bitbucket)
  2. Copy (or clone) the repository to your local machine
  3. Add a file to your local repo and 'commit' (save) the changes
  4. 'Push' your changes to your master branch
  5. Make a change to your file with a git hosting tool and commit
  6. 'Pull' the changes to your local machine
  7. Create a 'branch' (version), make a change, commit the change
  8. Open a 'pull request' (propose changes to the master branch)
  9. 'Merge' your branch to the master branch

Git Download

Mac OS/X

Download InstallerHomebrewMacPortsSourcetreeBuild Git on Mac OS X

Windows

Using SourcetreeGit for WindowsSourcetree

Linux

Debian / Ubuntu (apt-get)Fedora (yum)Build from source
Learn Git
Learn Git with Bitbucket CloudLearn about code review in Bitbucket CloudLearn Branching with Bitbucket CloudLearn Undoing Changes with Bitbucket Cloud
Beginner
What is version controlWhat is GitWhy Git for your organizationInstall GitGit SSHGit archiveGitOpsGit cheat sheet
Getting Started
Setting up a repositorySaving changesInspecting a repositoryUndoing changesRewriting history
Sourcetree
Collaborating
SyncingMaking a Pull RequestUsing BranchesComparing Workflows
Migrating to Git
SVN to Git - prepping for the migrationMigrate to Git from SVNPerforce to Git - why to make the moveMigrating from Perforce to Git
Advanced Tips
Advanced Git TutorialsMerging vs. RebasingReset, Checkout, and RevertAdvanced Git logGit HooksRefs and the ReflogGit submodulesGit subtreeGit LFSGit gcGit pruneLarge repositories in GitGit bashHow to store dotfilesGit cherry pickGitKGit-show
Sarah Goff-Dupont

Five tips for CI-friendly Git repos

Read article
Matt Shelton

Git or SVN? How Nuance Healthcare chose a Git branching model?

Read article
Matt Shelton

Dealing with Maven dependencies when switching to Git

Read article
See All Articles

Definition: A branch represents an independent line of development. Branches serve as an abstraction for the edit/stage/commit process discussed in Git Basics, the first module of this series. You can think of them as a way to request a brand new working directory, staging area, and project history. New commits are recorded in the history for the current branch, which results in a fork in the history of the project.

See All References

In this short post, I will show you how you can connect SourceTree with Azure DevOps. That way, you can work with your GIT repositories using the best of both worlds.

I like using SourceTree in my development teams since it is an easy interface. Another advantage is that it is available for both Windows and Mac OS. Last but not least; it supports the Gitflow Workflow, which is especially great for release-based projects.

Background

Back in 2018, Microsoft renamed VisualStudio Online into Azure DevOps. It sounds more catchy and it indicates its purpose more; enabling developer teams to take care of rolling out their software independently.

But changing a name for an online service also means changing the URL. And this is where a lot of people get mixed up on what to use for their GIT repo URL.

Using sourcetree with azure devops

Add in a snuff of confusion by changing the access for external tools from username password to a Personal Access Token (PAT) and you have a lot of people getting confused.

Because is more annoying than if you can’t get your favorite GIT client to work with a GIT repo that you want to clone.

Using Sourcetree

I got this working via the following steps: Amazon prime photos cost.

  1. Create a PAT in Azure DevOps (https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops)
  2. Make sure you copy the generated PAT as you won’t be able to view it again
  3. On Source Tree, go to add account and select Azure DevOps
  4. for the host, I used https://{organisation}.visualstudio.com as the new URL format for Azure DevOps didn’t work
  5. enter the generated PAT as username
  6. use the PAT you just generated for the password as well

After this, you can get the URL of your repository and add your repo to Sourcetree as described on the SourceTree help page.

The credentials appear to be ignored?

If somehow your Sourcetree doesn’t seem to be using the right PAT credentials when you try to clone your repo, force Sourcetree to use the credentials by prefixing the URL with them:

[crayon-6095071743bb4131410831/]

Using these steps, SourceTree will force using the PAT as credentials for the repo and you can clone and work on the repo directly.

Somehow, I couldn’t get the username — PAT as a password combination working. I found out this route and it works for me.

Please note

Using Sourcetree With Bitbucket

At the time of writing, there are some things you should know. I didn’t use them in my instructions to spare them for you and because you probably — like me — just want to get to speed and work with your repo:

  • The old “visualstudio” URL still needs to be / can be used for closing
    (read more here): https://*username*.visualstudio.com
  • Apparently, you can use the new URL alongside with your PAT, but you need a hacky way to do it (read more here)

Concluding

What Is Sourcetree

Hopefully, this post helped you save some time by showing you how to connect SourceTree with Azure DevOps.

Once you have them connected, they will play nice together. I found them to be a very nice couple with some great advantages:

  • SourceTree can be used by both Mac and Windows users on your team and makes your team talk in the same GIT lingo and use Git WorkFlow.
  • Whereas Azure DevOps lets you work on your product in an Agile manner, with planning boards, automated flows via Pipelines, and GIT repositories.

Sourcetree User Guide

Code Hard, Ship harder 🔥