Git Gui Sourcetree

SourceTree is a GUI for Git offered for free by Atlassian and it perfectly integrates Gitflow. Therefore the following chapter covers the basic task of Gitflow and how to perform them with the use of Sourcetree.

The first thing to do is to download and install SourceTree from their official page.

Clone a Git repository

Creating a new local repository form a remote source in Sourchtree you have to clone a project. To do so, click on the Clone / New button (top-left corner), select the 'Clone Repository' tab.

The Form will ask you for a source path (most likely an URL) which points to the remote repository and a destination path where to initialize the repository locally on your machine. Just give it a name and you should be done.

Actions: Stage, commit and push.

Two of the Git GUIs developers choose most often include Axosoft's GitKraken and Atlassian's Sourcetree; both tools are open source and available with free versions. Sourcetree is a simple, powerful Git GUI. Atlassian has enhanced the tool - though some users say sparingly - since its introduction in 2013. Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency; SourceTree: A free Git GUI client for Windows and macOS. This video series teaches you Git version control without having to use the command line. As an interface, we use SourceTree from Atlassian and KDiff3 by Joa.

It's really important to know the difference between staging, do a commit andpush commits. Let's define these 3 concepts:

  • Staging is the process where you can select which changes should be committed afterwards. This gives you the chance of bundle changes to have logical commit packages. You can select files or even chunks of code in files to be committed.
  • Commit is the process when your staged changes will be added to the git history. By providing a commit message you are able to describe your commits for others. It is important that you use descriptive commit messages and commit changes in logical packages. Choose many commits with small changes before less commits with a lot of bundled commits. A commit just happens locally, the remote repository didn't notice anything yet.
  • Push With a push, all the commits are sent to the remote server, so other userscan access and get these changes.

If you want to know more about this, please visit the official documentation

Merging branches

Merging needs to be performed everytime you need to to get updates of another branch to be applied to your branch.

To merge one branch into your current branch, just click on Merge

In that dialog you need to choose the commit of a branch you want to merge into the current branch. Usually this causes some changes to your code since it get's updated. Sourcetree automatically commits theses changes, all you have to do is push them to the remote server.

Git Gui Sourcetree

If conflicts happen you need to solve them first before being able to commit and push merge changes.

Initializing GitFlow

As mentioned, Sourcetree prefectly integrates Gitflow. To initialize a repository for Gitflow you just need to click on the Git Flow button.

Git Gui Sourcetree

You should leave the names of the branches as they are and just hit OK. Sourcetree will then create an additional develop branch off of master.

Adding new features

To create a new feature click on Git Flow and then in Start New Feature. Youshould see a dialog like this:

Add a descriptive name and hit OK. Sourcetree automatically creates the feature brachen following the naming convention feature/feature-name and you are atomatically switching to that branch.

Note that this branch is just visible for you at this point. To open this branch for collaboration you first need to push the branch to remote

You can work on this branch until you finish your feature. At that point and aftertesting everything, you should merge this feature into the develop branch. ButClick again in the Git Flow, you'll see a Finish feature button. Clicking this button is all you need to do. Sourcetree automatically merges your feature branch with develop.

NOTE: You may find problems during this process, as sometimes other peoplerelease versions, or there are simply conflicts between files. It's not possibleto cover all those cases in this guide, but the Git error log is explicative, soplease check the error that Git returns and do what they require you do to (mostlikely resolve conflicts or commit/discard changes)

Sourcetree github

Releasing a new version

Eclipse for java web development. To create a new release click on Git Flow again, and then on the Start New Release button. A dialog like this will be opened:

Sourcetree Install

By adding a new version nummber for the name of the release following the version name guideliens will create a new release branch and opens a reales cycle. You can now start performing deployment-oriented task like rewriting documentations, cleanup things or increment versioning numbers throughout your code.

Once that everything has been tested and it's ready to go live, you can finishthe release by clicking again on Git Flow >Finish release. SourceTree willmerge all branches automatically. You don't need to add a name for the tag since Sourcetree is automatically applying the release branch name as the tagname. Sourcetree will automatically merge your release into master and develop.

Applying a hotfix

When a bug in production is discovered, you have to create a hot fix for it. Bynow you can probably guess what do to. And yes: Click on Git Flow >Start New Hotfix,and select the name for your hot fix branch:

As it should be familiar for you already: Fix the bug, and when it's finished,just finish the hot fix but clicking again in Git Flow >Finish Hotfix. SourceTreewill (once again!) merge all the branches, delete the hotfix branch, etc.

An Example

If you follow all this rules your project should look something like this

Some useful links

Work with Git repositories, view, explore, modify GitHub projects

Sourcetree simplifies how you interact with your Git repositories so you can focus on coding. Visualize and manage your repositories through Sourcetree's simple Git GUI.

Sourcetree is perfect for making advanced users even more productive. Review changesets, stash, cherry-pick between branches and more.

Features and highlights

  • The new Git status
  • Visualize your progress
  • Git Large File Support
  • Git-flow out of the box
  • Submodules make life easier when managing projects
  • Search for commits, file changes, and branches
  • Interactive rebase
  • Remote repository manager

SourceTree 4.0.2 on 32-bit and 64-bit PCs

Git Gui Linux

This download is licensed as freeware for the Windows (32-bit and 64-bit) operating system on a laptop or desktop PC from programming software without restrictions. SourceTree 4.0.2 is available to all software users as a free download for Windows.

Filed under:

Sourcetree Github

  1. SourceTree Download
  2. Freeware Programming Software
  3. Major release: SourceTree 4.0
  4. Git Client Software