Tig is an ncurses-based text-mode interface for Git repositories.
Installation
# macOS with Homebrew
brew install tig
# Ubuntu / Debian
sudo apt install tig
Command Invocations
| Command | Action |
|---|---|
tig |
Open main commit log view |
tig status |
Open working tree status view |
tig blame <file> |
Open blame view for specific file |
tig <branch> |
Inspect commit history of a branch |
tig branchA..branchB |
View commit differences between branches |
tig <file> |
View commit history for specific file |
View Navigation Shortcuts
| Key | View |
|---|---|
m |
Main commit log view |
d |
Diff view |
t |
Tree view (directory browser) |
b |
Blame view |
s |
Status view (stage / unstage files) |
c |
Stage view (chunk/hunk inspection) |
y |
Stash view |
g |
Grep text search view |
h |
Help view |
General Shortcuts
| Shortcut | Description |
|---|---|
Enter |
Open selected line or commit |
< |
Return to previous view state |
Tab |
Switch focus between split views |
R |
Refresh current view |
q |
Close current view |
Q |
Exit Tig entirely |
j / k |
Move cursor down / up |
/ |
Search forward |
? |
Search backward |
Staging in Status View (s)
| Key | Action |
|---|---|
u |
Stage or unstage file or hunk |
! |
Revert file changes |
C |
Run git commit |
M |
Merge using external merge tool |