DEV Community

Roberto Dip
Roberto Dip

Posted on • Originally published at monades.roperzh.com on

Weekly Command: going over Git history with tig

There are many UI utilities that allow you to explore a Git repository, but for me, nothing beats tig.

A GIF showing examples of the usage of the tig command

The Basics

tig [view] [-options] [revs]
Enter fullscreen mode Exit fullscreen mode

tig is a text-based user interface for Git that can be used directly from your terminal to explore the repository in the current working directory. It can be invoked directly or by piping Git output.

Views

The program exposes different views, each view displays different data from the repository. You can tell tig to use a view with the optional view argument or you can switch views once tig is open with the default keybindings:

View Argument Keybinding
main view - m
diff view - d
log view log l
show view show -
blame view blame ** b *
grep view grep ** g
refs view refs r
status view status s
help --help h


  • You need to have a file selected in the UI ** You neeed to supply an argument

If you are familiar with Git commands, view names are almost self-explanatory, I strongly encourage you to download tig and try the different views by yourself, they are very intuitive to navigate.

Pager mode

You can also pipe regular Git commands via stdin to tig, for example:

$ git show | tig
Enter fullscreen mode Exit fullscreen mode

output of the git show command piped into tig

Resources

Top comments (0)