Chris Hannah
My little piece of the internet

Currently Listening

A Better Git Command Line Experience

I’ll start by saying that I’m the sort of person that prefers to use the command line for Git commands. But there are still occasions where I just found it annoying, such as managing huge amounts of branches, reading old diffs, and also when making a big commit, and wanting to get a quick overview of what’s being added.

For those occasions, I used Fork. Although I’m sure for my uses, I could have probably used any Git GUI. However, I’m now using a terminal UI called Lazygit. I think it’s incredible. It lets me stay in the terminal, but gives me the functionality (that I use) of a typical GUI app.

This is what it looks like:

Because it’s a terminal app, it’s full of keyboard shortcuts, that make everything super fast. For example, to pull changes, you just use a lowercase p, and to push it’s an uppercase P.

Most of them are that simple that you just tap one key, but they tend to be limited to the active panel. For example, if you want to manage branches, then the branches panel needs to be the active one. Once it’s active, you can use things like space to checkout the selected branch, n to create a new branch, d to delete, o to create a pull request, etc. There’s honestly so many that if you were to check out Lazygit, I’d recommend having a glance at the full list of key bindings.

This is obviously a small example, but here is the experience of committing files:

It’s not limited to the keyboard though, you can navigate Lazygit using the cursor as well:

After installing Lazygit, I haven’t needed to use a GUI application at all. I know some may prefer to use a GUI, but I certainly have found Lazygit so much easier to use. Especially because of the abundance of keyboard shortcuts, and also because it lets me keep my Git activity to a single terminal window.

Lazygit works everywhere, macOS, Linux, or Windows, so if you want to enhance your Git experience in the command line, I’d definitely recommend checking it out.

Reply via Email