An Introduction to GitUI

2 April, 2024

When I say that I don’t have many, if any, technical skills I’m not kidding. That said, I do have a (very) cursory knowledge of some things that are considered technical. That knowledge is very shallow and focused on what I need to do. I very rarely go beyond that.

One area in which that applies is software called Git. Git, in case you’re wondering, is an application (routinely run from the command line) that software developers and others use to keep track of the changes to files, especially when several people are working on those files. I’ve used it at various Day JobTMs in the past, but only in a superficial way — using maybe a half dozen options. The rest I don’t know about or want to know about.

Which brings us to the present time. I publish this blog, as well as my public notebook and home page, with GitLab Pages. Which means I need to use Git. While my use of Git is simple, I’m lazy and want to minimize the amount I type in a terminal window.

There are more than a few graphical applications for working with git, but I’ve never been comfortable with the ones that I’ve tried. Towards the end of 2023, a friend suggested that I give GitUI a go. I did just that. Let’s take a look at what I learned.

This post isn’t a comprehensive examination GitUI. I only look at the functions that I use. So this isn’t the deep dive you might be looking for.

A Little Background

GitUI is a TUI (text-based user interface). It’s reminiscent of many an application that I ran back in the old DOS days. Here’s what it looks like:

GitUI, showing no changed files

It’s nothing fancy, but it doesn’t need to be.

To get GitUI, download it and put it in a folder from which you can run it no matter where you are on your computer. For example, I put it in a folder called bin in my /home directory.

Using GitUI

When you run GitUI in a directory that’s not set up as a Git repository (a location where you store your files, which is also called a repo for short), this error message displays:

The error that displays when you run GitUI in a folder that’s not a Git repo

The easiest way to get around that is to go to folder set up as a Git repo in your file manager. Then, right click and choose Open in Terminal. A terminal window displays. From there, type gitui and press Enter.

When GitUI starts, you see a list of the files that have been changed (if any) in the upper-left pane of the application’s window. In the example below, you see a bunch of my draft blog posts:

Changed files in GitUI

Press a on your keyboard to add the files to the instance of Git that you’re using. In my case, that’s GitLab. The list of files moves to the lower pane of the GitUI screen, as you can see below:

Ready to commit using GitUI

Shifting those files to your instance of Git is a two-step process. Press c on your keyboard to commit the files — that signals your intention to shift them. A small dialog box displays. Here, you type a short explanation of why you’re committing the files, as shown in this example:

Writing a commit message in GitUI

Your message should probably be a bit more descriptive than the one above …

Next, press Ctrl-D on your keyboard and then press p to push the files to your instance of Git. After a few seconds, the deed is done.

Viewing Changes and Editing Files

Before you press a, you can view changes to files in your Git repo. Do that by pressing the down arrow key to highlight a file. The contents of the file display in the right pane of the GitUI window, as shown below:

Viewing changed files in GitUI

You can edit the file by highlighting it in GitUI and then pressing e on your keyboard. This opens the file in the editor specified in your .bashrc file (or equivalent). On my laptop, for example, that’s the micro text editor.

Final Thoughts

What I covered in the last few hundred words is only a portion of GitUI’s functions and capabilities. There are other commands that I use, but I don’t use all of them all of the time.

As I mentioned at top of this post, I have tried more than few graphical Git clients. I’ve never liked any of them all that much. GitUI is the first Git client that I’ve taken a shine to.

Using GitUI saves me 50 or more keystrokes when publishing my blogs and website, or when backing up my notes. That might not seem like a lot, but I only need to remember a few (individual) keystrokes instead of a command and multiple options for doing what I need to do.

For someone as lazy as I am, and whose use of Git is rather basic, GitUI is a boon.

Scott Nesbitt