Discovering the Power of Git (sponsor)

News

August 24th, 2020

Discovering-the-Power-of-git_header-image-2200x1100-1.png

Developing software is a complicated business – a beautiful one, for sure, but also a really demanding one. A major reason for this is the vast amount of tools, frameworks, devices, browsers, etc. that are involved.

And if we’re honest, we must admit that a modern development workflow contains too many moving parts to understand and master all of them. It starts with your editor / IDE, goes on to your programming language and your development framework, all the way to continuous integration, unit testing, version control, and countless other things.

If we want to stay both sane and productive in such a demanding environment, I believe we must realize two things:

  1. We need to pick a few “core” topics that we focus on. This is the mere handful of things we strive to deeply understand and master, in order to do great work.
  2. For anything else, we must rely on tools. To make an example: you could build a nice deployment workflow by hand. But it would be much wiser to rely on a tool like Travis CI (or any of the other tools in that area) that takes this topic off your plate entirely.

Great tools allow you to come as close to mastering a topic as possible – without having to become a world-famous expert. They give you access to the powerful stuff without forcing you to learn and know everything. And they help you achieve more with less time and effort.

Writing all this, I’m reminded of why we started building Tower, our desktop client for Git, back in 2010. Git was still new-ish and we had thousands of other things to worry about apart from mastering version control.

We created Tower for ourselves – to help us master version control with Git in an easy and powerful way.

Undoing Mistakes, Easily

Think about how great it is that you can simply press CMD+Z in a text editor to undo a mistake! Wouldn’t it be awesome to have something like that for Git? In fact, this is exactly what we have recently implemented in Tower: a simple “CMD+Z” saves you from a messed up merge, an inadvertently deleted branch, a discarded local change, a too-soon published branch, or simply a commit that shouldn’t have happened.

(Note: the “Undo” feature is a quite recent addition and first available in the Mac version of Tower. It will soon come to Windows, too).

It took us many months of hard work, but it was absolutely worth it: knowing that you can undo your mistakes in such a simple way is indeed priceless.

The Power of Interactive Rebase

Interactive Rebase is one of the more powerful features in Git. For those of you who are not familiar with it, yet, it allows you to…
– edit old commits (their messages, but also their changesets!)
– combine multiple commits into one
– reorder commits
– …and even delete commits you don’t want anymore!

It’s a very helpful tool for cleaning up your commit history before merging it into a shared / team branch. But it splits users into two camps:

a) Beginners often find it too complicated and shy away from its complexity. Sadly, this inevitably means that they will miss out on its benefits.
b) Experienced developers sometimes know and use it; but since the feature is so difficult to use, it costs them a lot of time and/or they make mistakes from time to time.

We knew that Interactive Rebase held a huge amount of potential for many developers – but it was so hard to access. That’s why we wanted to strip away as much of its complexity as possible and make it really easy to use.

We finally managed to integrate it right into the “Commit History” view and make it accessible via simple drag & drop and menu options:

We knew we had done the right thing when we started to receive comments like these:

Pull Requests on the Desktop

In the last few years, communication about code has shifted more and more into Pull Requests. Today, teams large and small are using Pull Requests as a tool for collaboration.

Our own team is no exception: we use Pull Requests heavily while building Tower. But it always felt “wrong” that we had to leave the desktop, the place where coding happens, in order to work with Pull Requests.

This is why we finally integrated Pull Requests into Tower:

You can now create and work with Pull Requests right on your desktop, in a consistent UI, no matter if you’re using GitHub, GitLab, Bitbucket, or Azure DevOps.

Quick Actions

A great GUI can help you become more productive, especially if it reduces the time you spend searching, browsing, and clicking around. In Tower, the “Quick Actions” dialog allows you to find (and do!) almost anything without having to take your hands off the keyboard:

  • Give it a branch name and it will offer to do a checkout.
  • Give it a file name and it will offer to show it in the File History.
  • Give it a commit hash and it will offer to show that commit’s details.

Life as a developer becomes a lot easier when you can stop searching and sifting through tons of data – and perform many tasks quickly and easily from the keyboard.

Submodules Without the Drama

Git’s Submodules are both a blessing and a curse. They are a blessing because they are a really good, clean way to integrate library code into your project. But they are a real curse when you have to manage and use them!

Just as an example: let’s say you’re using a Submodule in multiple branches; and let’s also say that you’re using different revisions of the Submodule in the different branches. When you switch between these branches, Git will leave you with an inconsistent situation because it did not automatically check out the corresponding revision of your Submodule. You’ll have to remember doing that by hand!

This (and a couple of other quirky behaviors) can quickly take the joy out of Submodules. When we integrated Submodules into Tower, we took great care to iron out these wrinkles: when you add a Submodule, switch branches, move things around, or even have to repair an invalid Submodule configuration, Tower will make sure that nothing breaks. And in case you want to make some changes inside a Submodule, you can open it right from its parent repository with a simple double-click.

Becoming More Productive

Our goal with Tower has always been to make Git easier for our users – and to make them more productive. Let’s look at some examples of where this shows in Tower:

  • A New Diff Viewer: Very recently, we gave our internal Diff Viewer a complete overhaul. It can now highlight inline changes, show/hide whitespace changes, display the complete file, and be completely customized through themes!

  • No More Passwords, Tokens, SSH Keys: You can easily connect your GitHub / GitLab / Bitbucket / Azure DevOps accounts with Tower. Once you’ve done that, you’ll never have to wrestle with passwords, authentication tokens, usernames, or SSH Keys anymore. Cloning and interacting with remote repositories, from that point on, is just a matter of a click.
  • Single-Line Staging & Discarding: To a great deal, the helpfulness of version control depends on a simple rule: that a commit should only include changes from a single topic (instead of mixing multiple topics in a commit, which makes it very hard to understand what really happened). Tower provides the ability to stage / unstage / discard individual chunks and lines from your changes, thereby enabling you to create granular and precise commits.

  • Automations for the Boring Stuff: Working with Git involves a lot of grunt work. But fortunately, Tower takes care of many of those tasks for you. Just to make two examples: you don’t have to regularly fetch new updates from a remote, and you also don’t have to remember to stage uncommitted changes before you pull/switch branches/merge… Tower does all of that for you automatically.

When we hear what people like about Tower, a couple of things come up again and again: they love that it makes them more productive, that it enables them to do advanced stuff that they’d have a hard time doing without it. Or, to put it another way: that it makes life easier for them.

If you want to give Tower a try, just download it from our website and test it 30 days for free. And if you are a student or teacher, you can use Tower for free!


Many thanks to Tower for sponsoring Laravel News this week.

Filed in:

Tobias Günther

Tobias Günther is the CEO of Tower (https://www.git-tower.com), the popular Git desktop client that helps more than 100,000 developers around the world to be more productive with Git.