Why You Should Ditch GUIs for Git Commands

Hello readers,

Last Update: January 2025 – updated link to gist

Why no more GUIs?

I spent a significant amount of time using GUIs like GitKraken and SourceTree. They are powerful tools. I found that using the Terminal offers a more efficient and flexible way to execute Git operations overall.

Why the switch?

Good question. Indeed, why would I move away from a GUI that can do whatever I wish? Some people, like me before, don’t care much about peeking behind the curtains. We want something that works and empowers us to advance, and that’s it. And that’s perfectly valid.

Lately, I’ve been inspired to delve deeper into mastering my tools—more than just mastering them, actually. Some of my peers in different companies have shown me the power of this approach. They’ve convinced me that it can significantly enhance my productivity. But, as with anything worthwhile in life, it comes with its challenges, right?

The Challenge with Git Commands

I’ve used Git for years now, but remembering every command (especially the more complex ones) is hard. Sure, simple command like clone, push, pull, and fetch are easy enough. But beyond that, it can get pretty verbose.

This lead to quick searches online or endlessly scrolling through the command history. (Tip: using CTRL+ R will allow searching your command history ✨)

Why Git Aliases?

For those who might not be familiar with a Git alias, it’s basically a shortcut. You can add this shortcut in your Git configuration. They allow to abstract repetitive actions that you do. Read more in the official docs from Git.

Being a fan of efficiency and automation, I started creating Git aliases. They’ve helped me save time and abstract away repetitive tasks. It’s a small step towards reducing context switching and focusing on what matters most. I thought I’d share them here, as part of our shared learning journey. Perhaps at least one of them will be beneficial to you 🤞🏾

Simple, like creating a branch from main

Let’s say that you’re building a new feature from main. You need to do the following operations:

git checkout main

git pull

git checkout -b <your-new-feature>

This might not look like much, but doing this several times in a week, month or year can add up. I don’t mean to say that it’s complex at all. Rather than being repetitive, we should look for ways to automate it as much as possible. This allows us to reduce the amount of context-switching and focus on what matters most.

I decided to make it into an alias. This makes it easier for me. I no longer have to do all three commands each time. The command alias new-branch allows me to do what’s specified above:

[alias]
new-branch = "!sh -c 'git checkout main && git pull && git checkout -b \"$1\"' -"

Now, I only need to run one command to achieve the same result! This small change has made a big difference in my workflow. What’s great is that as you can combine your aliases and Git commands. That leads to a really personal Terminal experience tailored for your needs.

To learn more about what kind of aliases you can gain from, check out the public gist that I created.

📖 TL;DR

  • Moving away from Git GUIs (e.g., GitKraken, SourceTree), use Git in the Terminal.
  • Why? Mastering terminal commands boosts productivity and provides more control over my workflows.
  • Challenge: Remembering complex and verbose Git commands is difficult, which led me to explore Git aliases.
  • Solution: Created custom Git aliases to automate repetitive tasks and simplify workflows.
  • Example: Built an alias to create a new branch from main with a single command instead of running multiple commands.
  • Check out my public gist for more useful aliases if you’re interested.
  • Tip: using CTRL+ R will allow searching your command history ✨

Thank you for being a continued reader 🚀

Leave a comment