July 10, 2025

How I Use: Tig for Git

How I use Tig as a Git TUI for efficient Git operations, including custom key bindings and workflow automation.

I use Tig to perform most of my Git operations. Here's how:

Summary

  • I have custom ctrl-shift-A (amend) and shift-P (force push) commands defined
  • I have ctrl-T bound in my terminal to open tig status

Tig Config

I have a file at ~/.tigrc:

# Press ctrl+a to amend the last commit with whatever is staged
bind status <Ctrl-A> !git commit --amend

# Press shift+p to push
# requires `git config --global push.default current`
bind status P !git push -u
bind status <Ctrl-P> !git push --force -u

This lets me press ctrl-shift-A to amend the last commit. If I have any staged files, they get added to the last commit. I'm also able to change the message of the last commit.

This lets me press shift-P to push.

This lets me press ctrl-shift-P to force push. This is useful if I've rebased or amended a pushed commit.

Terminal Config

In zsh (~/.zshrc), I have this key bind:

bindkey -s '^T' 'tig status^M'

When I press ctrl-T in a terminal, it opens Tig to the status view. I can immediately start adding files.

Status View

I mostly use Tig in the status view. If Tig is not in the status view, I press s to enter the status view.

I look at my untracked files, and my files with changes that are not staged for commit.

If I want to stage a file, I move to it with the arrow keys and I press u.

If I want to stage part of a file, I move to it with the arrow keys and I press enter. I use j and k to navigate the right-side view up and down. When I'm on the part of the file that I want to stage, I press u.

If I want to un-stage part of a file, I do the same as above, but I move to the file that's in the Changes to be committed section.

If I have a large list of files, I press ? and search for the filename.

If I've performed changes since I've had Tig open, I press shift-R to reload.

Log View

I press l to enter the log view.

I move up and down with the arrow keys. When I'm on a commit I want to view, I press enter. I use j and k to navigate the right-side view up and down.

Tig Git TUI Terminal Productivity