Tig – A Command Line Browser for Git Repositories

In a recent article, we’ve described how to install and use GRV tool for viewing Git repositories in Linux terminal. In this article, we would like to introduce to you another useful command-line based interface to git called Tig.

Tig is a free open source, cross platform ncurses-based text-mode interface for git. It is a straight-forward interface to git that can help in staging changes for commit at chunk level and works as a pager for output from different Git commands. It can run on Linux, MacOSX as well as Windows systems.

How to Install Tig in Linux Systems

To install Tig in Linux, you need to first clone the Tig repository to your system and install it as shown.

$ git clone git://github.com/jonas/tig.git
$ make
$ make install

By default, tig will be installed under $HOME/bin directory, but ff you wish to install it in another directory under in your PATH, set prefix to the desired path, as shown.

$ make prefix=/usr/local
$ sudo make install prefix=/usr/local

Once you have installed Tig on your system, using the cd command get into your any of your local git repositories and run tig without any arguments, which should show all commits for the repository.

$ cd ~/bin/shellscripts/
$ tig  
Show Git Repository Commits
Show Git Repository Commits

To quit Tig, press q to close it.

Display Repository Activity Log

To display a log activities of the above repository, use the log sub-command.

$ tig log
View Git Repository Log
View Git Repository Log

Show Repository Objects

The show sub-command allows you to display one or more objects such as commits and many more, in a more detailed way, as shown.

$ tig show commits
Show Git Repository Objects
Show Git Repository Objects

Search A Pattern/Word in Git Files

You can also search for a particular pattern (for example the word check) in your git files with the grep sub-command, as shown.

$ tig grep check 
Search a Work in Git Repository
Search a Work in Git Repository

Display Git Repository Status

To display status of your git repository use status sub-command as shown.

$ tig status
Show Git Repository Status
Show Git Repository Status

For more Tig usage, please refer to help section or visit the Tig Github repository at https://github.com/jonas/tig.

$ tig -h

Tig is a simple ncurses-based interface to git repositories and mainly act as a Git repository browser. Give us your feedback or ask any questions via the comment form below.

Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.