DEV Community

Cover image for Gitui is a blazing fast terminal git interface
Waylon Walker
Waylon Walker

Posted on • Originally published at waylonwalker.com

Gitui is a blazing fast terminal git interface

Gitui is a terminal-based git user interface (TUI) that will change the way that you work with git. I have been a long-time user of the git cli, and it's been hard to beat, mostly because there is nothing that keeps my fingers on the keyboard quite like it, except gitui which comes with some great ways to very
quickly walk through a git project.

installation

Go to their [releases]https://github.com/extrawurst/gitui/releases) page,
download the latest build, and pop it on your PATH. I have the following stuffed away in some install scripts to get the latest version.

install latest release

GITUI_VERSION=$(curl --silent https://github.com/extrawurst/gitui/releases/latest | tr -d '"' | sed 's/^.*tag\///g' | sed 's/>.*$//g' | sed 's/^v//')
wget https://github.com/extrawurst/gitui/releases/download/v${GITUI_VERSION}/gitui-linux-musl.tar.gz -O- -q | sudo tar -zxf - -C /usr/bin/
Enter fullscreen mode Exit fullscreen mode

run gitui

It opens blazing fast.

gitui
Enter fullscreen mode Exit fullscreen mode

Quick Commits

Sometimes I edit a number of files and want to commit them one at a time, this is painful in the git cli and my main use case for gitui. gitui shows unstaged changes at the top, staged changes on the bottom, and a diff on the right.

gitui status

Navigate with hjkl

By default, gitui uses arrow keys, but simply copying vim_style_key_config.ron to your config directory will get you vim-like keybindings.

workflow

Generally, I pop open gitui, use j/k to get to the file I want to commit, glance at the diff to the right, press enter to stage the file, sc to switch focus to the saged files and commit, write my commit message hit enter and done.

  • w/s: to toggle focus between working and staged changes
  • j/k: to scroll each section
  • h/l: switch between left and right side
  • enter: toggle file from working or staging
  • c: start a commit message
  • p: push
  • : quit

Other Panes

I am in the Status [1] pane 90% of the time, but it also has three other panes for Log [2], Stashing [3], and Stashes [4]. I do not really use the stashes panes, but the Log [2] pane is quite useful to quickly go through the last set of commits and see the diff for each of them.

What UI do you use for git

Let me know what ui you use for git, do you stick to the cli, use a gui, or use a similar TUI interface?

Top comments (14)

Collapse
 
thefluxapex profile image
Ian Pride

I do most things from cli and only use ui's as a last resort, but I have been interested in looking into this for a little while, maybe it's time to check it out...

On another sort of off-topic note; I love wget and all, but I don't understand why lots of these GitHub projects don't have installers. I know most of us devs like to do things manually, but it's nothing anymore to build a quick installer for any files at GitHub, especially with JSDELIVR, which seems pretty dependable and if an installer is open source and does what it says then I prefer to use it. I built a nice reusable method in Rust recently to do so and so I've already built installers for a few other people's projects to use myself lol and one project that is released officially.

And on another sort of off-topic note: have you heard of axel as an alternative to wget? It's not necessarily a replacement as there are a couple of things it can't do that wget can, but for normal case uses axel is like a hot rod that goes from 0-60 in a few seconds and especially great for large files.

Collapse
 
waylonwalker profile image
Waylon Walker

Definitely give this one a try. It is so ridiculously quick and easy to keyboard navigate. Makes for a good tool to have in your toolbelt.

I'm with ya on all of these amazing new rust cli tools that are wicked fast all being deployed to github releases. I am surprised that there is not an installer tool for that use case.

I have not used axel, I may need to check that out.

Collapse
 
cadams profile image
Chad Adams • Edited

I use the built in git from VSCode 99% of the time. I’m more productive using that but that's just me.

I used to use Git Fork GUI but all the development I do nowadays is in VSCode so it’s convenient for me not having to leave my editor. As far as the terminal I just find typing the commands out every time to be tedious.

Collapse
 
waylonwalker profile image
Waylon Walker

vscode has a really great integrated git interface. The diff interface is very intuitive and beautiful. Not sure if it was my setup with wsl1, or having too many simultaneous projects open, but I found it took a lot of resources for me and was not easily keyboard navigatable.

Collapse
 
jumanjii profile image
Allan Jacquet-Cretides

Big thanks for the sharing.

I stay on the CLI because it's the simplest things hard to beat to me
git add -p is one of my best friends ^_^

I installed vim-fugitive but never invest time into it (remembering this I will probably soon now 😂)

Still this TUI that you shared seems nice.
Being already a user of tig for browsing the history of a repo, I will probably give a shot to this gitui

Thanks again :-)

Collapse
 
waylonwalker profile image
Waylon Walker

I dont think I have ever used git add -p, but I do use gitui to stage hunks, you can select them from the diff panel.

I am with you on fugitive. I see others use it so fluidly and think I need that, but it never actually clicks with me.

Collapse
 
jumanjii profile image
Allan Jacquet-Cretides

If I finally discover that it’s an awesome tools, maybe I will write an article to share 😄

Collapse
 
ybbond profile image
Yohanes Bandung Bondowoso

I've been using lazygit. It is fast, has many git features (squash, reorder commits, hunk stage).

I recall I tried gitui before, and IIRC, back then hjkl as navigation keys are not supported. Now that you've shown me how to do that, I might try again. Thanks!

Collapse
 
waylonwalker profile image
Waylon Walker

If I remember right the author was using lazygit before creating gitui. Based on his comparison in the readme they are kinda in the same ballpark, but gitui is more performant and stable.

I will say that gitui feels quite early in development. Its very active and adding new features. I haven't used other git TUIs much more than exploring them, but I would think gitui has less features at this point.

I wouldn't think that speed would matter quite like it does, but I find myself more apt to use it as it opens and closes instantly for my repos.

Collapse
 
rranslam profile image
Rob Ranslam

Nice. I typically start up git gui& running along in the main repo, but there are a lot of times I'm working in multiple repos, or ssh'd into another machine. I'll give this a go. I think I'll like it. Thanks for the info!

Collapse
 
samrocksc profile image
Sam Clark

This is actually pretty cool! It reminds me of vim-fugitive(By the great Tpope). Thanks for the share!

Collapse
 
jeromediver profile image
Jérôme Lanteri

I use from CLI command, but also from Vscode and Pycharm with own plugins to go with and sometimes from gitkraken UI application (who is very nice).

Collapse
 
waylonwalker profile image
Waylon Walker

I have a friend raving about gitkraken, I should check it out.

Collapse
 
3vl profile image
Victor Lewis

Tower is the only thing I’ve found that got me off the command line