explaingit

jonas/tig

13,227CAudience · developerComplexity · 2/5Setup · easy

TLDR

Tig is a terminal-based Git browser that shows commits, diffs, blame views, and lets you stage changes interactively, all from a keyboard-driven split-pane layout inside your terminal.

Mindmap

mindmap
  root((tig))
    What it does
      Browse commits
      View diffs
      File blame
      Stage changes
    Interface
      ncurses panes
      Keyboard driven
      Split view
    Views available
      Log view
      Diff view
      Blame view
      Tree view
    Tech stack
      C language
      ncurses library
    Platforms
      Linux
      macOS
      Wine on Windows
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Browse a Git repository's commit history and diffs interactively without leaving the terminal.

USE CASE 2

Stage or unstage individual diff chunks before committing, using a visual pane layout.

USE CASE 3

View the blame for a file to see who wrote each line and which commit introduced it.

USE CASE 4

Pipe output from git commands into Tig to navigate the result interactively with the keyboard.

Tech stack

Cncurses

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

Tig is a terminal program for browsing Git repositories using a text-based, keyboard-driven interface. Rather than running git log, git diff, and git show as separate commands and reading pages of flat text output, Tig puts the same information into an interactive split-pane layout that you navigate with the arrow keys. The main view shows commits in reverse chronological order. Pressing enter on any commit opens a pane below with the diff for that commit. You can move between commits, inspect which files changed, and read the file blame view, which shows who wrote each line of a file and which commit introduced it. Navigating between branches is also possible from within the same interface. Tig also helps prepare commits. It displays unstaged changes in the same pane layout and lets you select and stage or unstage individual diff chunks, similar to what git add -p does interactively but with a persistent visual layout. It can also function as a pager for the output of other git commands, meaning you can pipe git output into Tig and navigate the result interactively with the keyboard. Installation is straightforward. On Debian or Ubuntu, apt install tig works. On macOS, brew install tig is the common approach. The source is written in C and uses the ncurses library, which has been a standard part of Unix-like systems for decades. The program runs in any terminal emulator without needing a graphical desktop. The project works on Linux and macOS, and has been tested on Windows through Wine. A separate manual covers the full keyboard shortcuts and configuration options. Bug reports are accepted through the GitHub issue tracker or through the Git mailing list.

Copy-paste prompts

Prompt 1
How do I use tig to view the blame for a file and jump to the commit that introduced a specific line?
Prompt 2
I want to stage only certain hunks from my unstaged changes using tig. Walk me through the steps.
Prompt 3
How do I navigate between branches in tig and open a specific commit's diff?
Prompt 4
What are the most useful tig keyboard shortcuts for reviewing changes in a terminal?
Open on GitHub → Explain another repo

← jonas on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.