Discovering the Power of Git (sponsor)

Published on by

Discovering the Power of Git (sponsor) image

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.

Tobias Günther photo

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.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Paragraph

Manage your Laravel app as if it was a CMS – edit any text on any page or in any email without touching Blade or language files.

Visit Paragraph
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Lucky Media logo

Lucky Media

Bespoke software solutions built for your business. We ♥ Laravel

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
All Green logo

All Green

All Green is a SaaS test runner that can execute your whole Laravel test suite in mere seconds so that you don't get blocked – you get feedback almost instantly and you can deploy to production very quickly.

All Green
Larafast: Laravel SaaS Starter Kit logo

Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes. Available with VILT and TALL stacks.

Larafast: Laravel SaaS Starter Kit
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector

The latest

View all →
Property Hooks Get Closer to Becoming a Reality in PHP 8.4 image

Property Hooks Get Closer to Becoming a Reality in PHP 8.4

Read article
Asserting Exceptions in Laravel Tests image

Asserting Exceptions in Laravel Tests

Read article
Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4 image

Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4

Read article
Basset is an alternative way to load CSS & JS assets image

Basset is an alternative way to load CSS & JS assets

Read article
Integrate Laravel with Stripe Connect Using This Package image

Integrate Laravel with Stripe Connect Using This Package

Read article
The Random package generates cryptographically secure random values image

The Random package generates cryptographically secure random values

Read article