Stop Using the Git CLI
Drop the Git GUI stigma, learn more about Git, and never accidentally push to master again
If you are a developer, you probably use Git. If you don’t, I hope you are using some sort of source control!
If you are using Git, you are either using the CLI or a GUI that wraps the functionality. Using a good GUI is better.
Oh, My Eyes…
The first main advantage of using a GUI is that you are getting a Graphical User Interface — an actual UI tailored to you, the developer. Developers have written this program to help other developers do their jobs. I cannot overstate this. As soon as you get the hang of using a GUI, you will be able to look at your codebase in a completely different manner.
And thus I will introduce my preferred Git GUI, GitKraken:
If you have been working with Git for a while, I hope this will please your eyes. You can instantly and easily see every commit from everyone in your codebase. View remote branches, merges, and tags.
This is more than pretty. With this view, you can easily see changes. This means you can easily see breaking changes (e.g. to your master branch).
This has affected my performance at work. At my company, all merges to master spin off a new build of our application. Suddenly, we stopped getting builds. QA posted this on a public channel. I was able to go to the last tag where we did have a working build and then click through each commit, line by line, very quickly. Spotting the breaking change was then trivial. I opened a quick PR to fix it and had my five minutes of fame. But it was all due to GitKraken!
Don’t Mess Up Your Commands
I also spend no time typing in branch names or remembering Git commands — or misremembering them!
Another advantage of GUI is that it is far less error-prone. You can more easily see what branch you are on as well as see what is committed or not committed. You will be much less likely to accidentally push to master! I know it can be fun to slam through some commands in the CLI, but every time you are typing, you can make an error or forget what branch you are on.
Learn More About Your Tools
Speaking of Git, when was the last time you actually went and read the documentation or learned something new about Git? I almost never have. I still learn things, though… just through the use of GitKraken. For example, just right-click on a commit:
Do you know what every single option does here? Did you know that Git can do all that? Git is an extremely powerful tool with a lot of ways to use it. But when you use the CLI, you learn the few commands that get you by (
branch) while not knowing what Git truly has to offer.
Or maybe the subtleties of Git are not so clear:
The UI shows you the different ways of getting code from the remote repo. From here, you can easily google the different types of pulls. I wouldn’t have known that these existed! If you are curious, take a look at the documentation.
After really learning how Git works, I can now cherry-pick, make demo branches, merge between them, and more easily parallelize my work without fear of messing things up.
Hopefully, you feel some inclination to use a Git GUI. If you have read this far, you probably are open to switching, but many people are not. For some reason, there is a stigma against using a Git GUI. It is not “cool.” We all want to feel like next-level hackers, and let’s be honest, that’s part of the reason we are in this line of work.
But this is not a valid reason to limit yourself. It is almost akin to sticking to an older programming language just because you feel comfortable with it. Good engineers don’t do this!
I think people also look down upon GUI usage and view it is a crutch. Pros use the CLI. Well, professionals don’t make errors and that is arguably the biggest upside to a GUI.
In some ways, getting better at Git is even more important than learning new languages because source control is a skill used in all development — regardless of language.
Don’t feel peer pressure or reinforce these stigmas. It is OK to use a GUI and it is OK to use the CLI. Just admit you like the CLI because it’s fun.
Thanks for reading!