If you find navigating your Git repositories frustratingly complex, have I got the tool for you. Meet Tig.
Tig is an ncurses-based text-mode interface for Git that allows you to browse changes in a Git repository. It also acts as a pager for the output of various Git commands. I use this tool to give me a good idea of what’s been changed in which commit by whom, the latest commit merged, and so much more. Try it for yourself, starting with this brief tutorial.
On Linux, you can install Tig using your package manager. For instance, on Fedora and Mageia:
$ sudo dnf install tig
On Debian, Linux Mint, Elementary, Pop_OS, and other Debian-based distributions:
$ sud apt install tig
Tig provides an interactive view of common Git output. For instance, with Git you can view all refs with the command
$ git show-ref
With Tig, you can get that information and much more in a scrollable list, plus keyboard shortcuts to open additional views with details about each ref.
Tig enters pager mode when input is provided to stdin (standard input). When the
show subcommand is specified and the
--stdin option is given, stdin is assumed to be a list of commit IDs, which is forwarded to
$ git rev-list --author=sumantrom HEAD | tig show –stdin
Log and diff views
When you're in Tig's log view, you can press the d key on your keyboard to display diffs. This displays the files changed in the commit and the lines that were removed and added.
Interactive Git data
Tig is an excellent addition to Git. It makes it easy to review your Git repository by encouraging you to explore the logs without having to construct long and sometimes complex queries.
Add Tig to your Git toolkit today!