Hey, you! Have you been using git at your job, but feel like you’re mostly just scraping by with the few commands you know? Do you rely on GUI tools to manage your git operations? Stop it! Bad developer!
You need to learn the git command line.
Even though you might feel like it’s quicker to use the GUI, or easier to understand, you’re just asking for trouble. Git is a sharp tool, and it can bite you. Badly. What you want to do is actually understand what Git is doing so that you can avoid making horrible, irreversible mistakes. If you use a GUI, you’re looking at another level of abstraction above the git commands, and that means not only do you still need to know the git abstractions (to avoid doing something that deletes data), but you also now need to know the mapping from the GUI tool to those git abstractions. And that mapping may not even be 1 to 1 – the GUI may execute multiple commands on your behalf when you click that button.
You can’t escape the abstractions that git provides by using a GUI. You’re eventually going to end up in a situation where you are confused about what is going on, and you’re going to end up deleting your repository and re-cloning it from scratch, losing some of your work along the way. Git is the tool that’s supposed to prevent you from losing your work, but in this case, it’s actually causing it!
However, you can’t blame git for this unfortunate series of events – Git is well-documented and tested, and will never delete your important data if you know what you’re doing. The Git command line can admittedly be confusing at first (especially with all the crazy options each one has), but the abstractions Git uses to interact with your data are really solid.
There's nothing wrong with GUIs or IDEs
That said, there is nothing wrong with using a GUI tool or an IDE like Intellij to help you out once you know the command line. The problem is starting out with the GUI tool thinking you can shortcut the work necessary to learn the mental model of git. GUIs and IDEs are like shorthand for the commands you already know – they can be convenient in that they don’t make you type out a big long command and remember all of the weird command line switches to get what you want done.
My favorite place to send people to learn Git is on the official git-scm site. The book they have is free, called Pro Git. They give you both an overview of the concepts, and lots of detail on each command all the way up to the advanced stuff. I am also writing a book to try and teach it from a different angle, but it’s not done yet, so not all that useful to you at the moment. However, if you’d like to get updates from me about it’s progress and receive free tips & tricks about Git, you can put in your email address below to sign up for my mailing list!