Git Sourcetree

Software developers, students, and a few sea creatures have spoken. GitKraken is the most popular Git GUI in the world—named the most used graphical user interface for Git in the 2020 State of the Software Development Report.

Git-Flow provides a powerful and widely used Git workflow immediately once you install Sourcetree. The workflow defines a strict branching model that is designed around the release process. Using this workflow gives you a robust framework for any size project. We will begin by discussing the installation of SourceTree. As a final reminder, this video is about the SourceTree Git Client. You have the option of using the command line instead, skip this material if you plan on using the command line. SourceTree is a free, Git client for Windows and the macOS.

This video demonstrates how to create a local repository using Sourceree. You should already be familiar with these Git locations. We will use Sourcetree to create a local repository, which automatically includes the working tree and staging area.

You might, however, be on the fence; maybe you’re Git-curious, but not sure whether to ‘commit’ (sorry) to a GUI. After all, there are several out there. Which one should you choose? If you’re still deciding which Git client is best for you, we’ll save you some time.

Download the GitKraken Git GUI to maximize your productivity with Git.

So, how do Sourcetree and GitKraken compare? GitKraken satisfies developers worldwide with Linux support, cross-platform consistency, intuitive input actions, interface design, undo button, and more.

Linux Support

GitKraken ✅ Sourcetree ❌

Stack Overflow’s 2019 Developer Survey reports that over 25% of developers choose Linux as their primary OS. While many of our competitors neglect the growing market of Linux lovers, GitKraken, will dutifully manage your Git projects without bias toward your operating system. Windows, Mac and Linux users rejoice!

Sourcetree, by comparison, does not support Linux.

Cross-Platform Consistency

Sep 11, 2019 Step 1: Locate the Git window. For Windows, the Custom Actions configuration is located in Tools Options Git. For Mac, the Custom Actions configuration is located in Preferences Git. Using Embedded Git. Just select 'Use Embedded Git' (on Windows) or 'Reset to Embedded Git' (on Mac) to select the Git version which is embedded into Sourcetree. Once installed, SourceTree will automatically try to look for and set up repos that are worked on. SourceTree will also detect if git-flow is used and what is the current development state as long as default git-flow branch names are used. The software tracks.

GitKraken ✅ Sourcetree ❌

We formerly covered that GitKraken is able to offer an identical experience of our application across Windows, Mac, and Linux.

Not only is this feature appealing to developers, who in turn get to use the OS of their preference, it’s also beneficial for teams and organizations. Empowering your engineers with the tools they want to use will lead to happier employees and improved productivity.

Sourcetree’s experience varies greatly depending on whether you’re using the tool on Windows or Mac. Users often complain of frustrating discrepancies between versions. Having varied features across OS can be challenging when you need to troubleshoot an issue.

Furthermore, Sourcetree is not a focus of Atlassian, shown by a lack in communication and infrequent application updates.

GitKraken is a primary focus of Axosoft’s development team, making it possible to provide frequent updates and improvements, in addition to discoverable and helpful online resources and support.

Commit Graph UI

GitKraken 👍 Sourcetree 👎

GitKraken’s interface is simple, intuitive and customizable with light and dark themes. If you’re going to use a GUI, it should look good! You’re worth it! Treat yourself!

The graph in GitKraken is not only a beautiful representation of your work, it is also a highly functional tool for managing your branches and commits. Interact directly with branches and commits when you merge with drag-and-drop, create branches, or revert commits. If you’re collaborating on a project, avatars act as visual markers that let you know who committed work. Icons on branch labels show which remotes and PRs they belong to.

The difference in UI is eloquently described by Satoripop developer, Ghassen Rjab, in his article, “Is it better to use GitKraken or Sourcetree for Git?

“In GitKraken’s main interface, we have everything we need. In the left panel, we have information about the project, such as local branches, the remote repositories added to the project and their branches, stashes, tags, and submodules. The project’s history and the work in progress are in the center, and we can see stashes too. In the right panel, we can see details of any commit we select from the history. At the top, we have the search button that we can use to look for commits.

All these features exist in the main interface, which makes it a great experience to work with GitKraken.”

By comparison, Sourcetree’s UI is split into three views: File Status, Log/History, and Search.

“The Sourcetree UI will make your UX a bit frustrating as you’ll always need to switch between these three tabs to get your work done.”

Undo/Redo Button

GitKraken ✅ Sourcetree ❌

One-click undo! What Git client can do that? Certainly not Sourcetree.

A crowd favorite, GitKraken’s Undo/Redo button has been a lifesaver for many developers, who may have accidentally discarded hours-worth of code changes. 😱

GitKraken allows users to undo the following actions with the click of a button: checkout; commit; discard; delete branch; remove remote; and reset branch to commit. You can also redo these actions if you ever undo them by mistake. 😅

Merge Conflict Resolution

GitKraken 👍 Sourcetree 👎

Resolve merge conflicts with more control over which bits of code to include by using GitKraken’s built-in merge tool. With Sourcetree it’s “mine,” “theirs,” or open another application.

GitKraken will display any conflicting files in the right commit panel. Clicking on a conflicted file will open the merge conflict editor where the current branch is displayed on the left, the target branch on the right, and an output field at the bottom.

Users can select all changes in a file, individual sections, or individual lines of code, all of which are displayed with an accompanying checkbox. Simply check the box to add that piece of code to the output field where you can see your options in context and decide which changes are preferable. (GitKraken users with paid accounts can even edit in the output field directly 🤯). After you have resolved the conflict, save the output and commit your changes.

With Sourcetree, you’re better off using an external merge tool.

Issue Tracking Integrations

GitKraken ✅ Sourcetree ❌

The GitKraken Git GUI is like no other tool of its kind on the market for many reasons, but this is a big one. No other Git clients offer robust integrations with the most popular issue trackers used by software developers and teams. None.

What is sourcetree

The GitKraken Git GUI integrates with the following issue trackers:

Users who utilize one of the above tools to manage their issues can accomplish the following actions directly from the GitKraken Git GUI: view, filter, and edit issues/cards, create branches tied to issues/cards, and create new issues/cards.

No more context switching to stay on top of your issues – simply do so from your beautiful coding environment.

Sourcetree, by comparison, does not offer robust issue tracking features and does not integrate with Trello, GitKraken Boards, GitLab Issues, or GitHub Issues.

Drag-and-Drop

GitKraken ✅ Sourcetree ❌

With GitKraken you can use the input methods you’re most comfortable with. Execute Git actions using drag-and-drop, or stick to the keyboard and switch repos, check out branches, etc. with GitKraken’s Fuzzy Finder. This is something you can also do in Sourcetr– oh no, you can’t.

Users on GitKraken can drag-and-drop to initiate interactive rebase or create a pull request (after setting up the integration to your hosting service); users can also drag-and-drop a branch onto a remote to perform a Push.

Don’t worry, GitKraken has something for you keyboard lovers out there too: our Fuzzy Finder, which allows users to access a variety of actions via keyboard shortcuts.

Sourcetree lacks drag-and-drop functionality and does not offer discoverable keyboard shortcuts.

Git Sourcetree Change Commit Message

Stand-Alone Licenses for Teams

GitKraken ✅ Sourcetree ❌

The GitKraken team has thoughtfully evolved our product offerings to support enterprise organizations required to work in disconnected or firewalled environments. Senior leadership can choose from our stand-alone or self-hosted options to best fit their needs.

While Sourcetree advertises an Enterprise option that offers better account management, they do not offer a version of their application that can be self-hosted.

If you do want the account management offered with Sourcetree Enterprise, you will need to download an MSI file installer to manage the process.

Sourcetree or GitKraken: Ready to make the Switch?

If you were already using Sourcetree, do yourself a favor. MAKE. 👏THE. 👏SWITCH. 👏 Trust us and many of those who have made the same transition: you will not regret it.

Git Sourcetree

Plus: we’re ready to sweeten the deal with a HUGE discount on GitKraken Pro!

Stay on the cutting edge of software development by getting innovative tips, trends and stories delivered to your inbox every month!

Back to list

October 5, 2019 • 3 min to read

A list of git daily basis commands with Sourcetree GUI

git, sourcetree

Introduction

Remembering many git commands and also doing it in the terminal can be hard if you don't have too much practice. Graphical User Interfaces (GUI's) can make your life easier and improve your productivity. One of that is the Sourcetree.

Sourcetree is a free Git client for Windows and Mac that simplifies how you interact with your Git repositories so you can focus on coding. It enables you visualize and manage your repositories through a simple Git GUI.

In this post we will show how to run some git daily basis commands with the Sourcetree GUI.

Commmands

Log

Shows the commit logs.

Command: git log (doc)

In Sourcetree we can check the log in the History tab.

Git Sourcetree Tutorial

Commit

Record changes to the repository

Command: git commit -m <message> [--amend] (doc)

In Sourcetree you can achieve the same result clicking in the rounded Commit button at the top left corner, write the message in the text box and commit it by clicking the right bottom button.

Adding the amend option you will replace the tip of the current branch by creating a new commit. For doing this in Sourcetree you need select the Commit Options in the right top of the commit input box and select the option Amend last commit.

Diff

Show changes between commits, commit and working tree, etc

git diff <commit1> <commit2> (doc)

For doing the same in Sourcetree you just need select 2 commits in the History.

Stash

Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.

git stash push -m <message> (doc)

In Sourcetree for push a new stash you need select the Stash button in the top toolbar.

For apply or delete a stash you can use the Stashes menu in the sidebar.

Checkout

Switch branches or restore working tree files

git checkout -b <branch> (doc)

In Sourcetree first you need right click in the commit you want and select the Branch option.

Then you just need add the branch name and confirm.

Add Remote

Adds a remote named <name> for the repository at <url>.

git remote add <name> <url> (doc)

For adding a remote you need first create a remote repository in some host service like Github or Bitbucket. For example, after create a repository on Github you have some like that:

To add this remote in Sourcetree first you need right click on the Workspace menu in the sidebar.

Then add the remote <name> (usually defined as 'origin') and <url> in the fields and click in OK. That's it. Your new branch is ready.

Sourcetree

Merge

Join two or more development histories together

Best Git Gui

git merge <branch> (doc)

For merge branch in Sourcetree you just need right click in the branch commit that you want and choose the option Merge.

If you have some conflict you can also fix it by right clicking in the conflicted file, select the Resolve Conflicts and pick the desired option. Resolve Using 'Mine' means you want use the solution of your current branch and Resolve Using `Theirs' means you want replace the solution for the selected commit.

Squash

To Squash commits you should use rebase command in interactive mode. Rebasing interactively means that you have a chance to edit the commits which are rebased. You can reorder the commits, and you can remove them (weeding out bad or otherwise unwanted patches).

Start it with the last commit you want to retain as-is:

git rebase -i <after-this-commit> (doc)

An editor will be fired up with all the commits in your current branch (ignoring merge commits), which come after the given commit. You can reorder the commits in this list to your heart’s content, and you can remove them. The list looks more or less like this:

You can squash commits changing the word pick into squash (or just s) next to it. The result would be:

For squash commits in Sourcetree first you need right click in the commit before that you want and select the option Rebase children of <commit> interactively....

Then select the commits you want squash and confirm. You can also edit the commit message if you want.

Conclusion

In this post we learned some useful git daily commands (like commit, merge, stash, etc.) using the Sourcetree GUI. It enables you visualize and manage your repositories improving your productivity and making you focus on what matters: coding.

If you have some suggestion please let me know commenting below or submitting a PR for this post :).

Something Missing?

This project is open-source, so if something is missing or if you found some part confusing, please submit a pull-request in theGithubrepository for this post with your suggestions for improvement. It is a simple and effective way to contribute to the web development community.

Comments