TIG(1)

๐Ÿ’– TIG(1) โ€” the tig manual, but make it make sense ๐Ÿ’–

okay bestie, pull up a chair, we're learning tig โ€” the text-mode interface for Git. yes this is the actual TIG(1) manual page, i just gave it a glow-up โœจ


๐ŸŒธ NAME ๐ŸŒธ

tig โ€” text-mode interface for Git. that's it, that's the name, she's simple and she SERVES ๐Ÿ’…


โœจ SYNOPSIS โœจ

tig        [options] [revisions] [--] [paths]
tig log    [options] [revisions] [--] [paths]
tig show   [options] [revisions] [--] [paths]
tig reflog [options] [revisions]
tig blame  [options] [rev] [--] path
tig grep   [options] [pattern]
tig refs   [options]
tig stash  [options]
tig status
tig <      [Git command output]

like, look at all these entry points. she's versatile. she contains multitudes ๐Ÿฆ‹


๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

tig is an ncurses-based text-mode interface for git(1). her main job? being a Git repository browser. but she's also lowkey multi-talented: she can help you stage changes for commit at chunk level, and she can act as a pager for output from various Git commands. main character energy, no cap ๐Ÿ‘‘


๐ŸŽ€ OPTIONS ๐ŸŽ€

so the command line options tig recognizes include ALL valid git-log(1) and git-diff(1) options, plus the subcommands and tig-specific options below. ๐Ÿ’–

important lore: the first command line parameter not starting with "-" gets interpreted as either a revision specification or a path, and that ends the option parsing. everything after that? passed straight to the underlying Git command.

๐Ÿšจ bestie this next part is a TRAP and everyone falls for it: any arguments to options have to be glued on. run tig -Sfoo instead of tig -S foo, and tig --grep=foo instead of tig --grep foo. otherwise foo gets read as a revision instead of an argument. the way that... ๐Ÿ˜ญ
  • show โ€” opens the diff view using the git-show(1) options you hand her.
  • blame โ€” shows the given file annotated by commits. takes zero or more git-blame(1) options. optionally you can limit it from a given revision.
  • status โ€” starts up in the status view. straight to business ๐Ÿ’…
  • log โ€” starts up in log view, showing git-log(1) output.
  • reflog โ€” starts up in reflog view.
  • refs โ€” starts up in refs view. all refs are displayed unless you limit it with one of the --branches, --remotes, or --tags parameters.
  • stash โ€” starts up in stash view.
  • grep โ€” opens the grep view. supports the same options as git-grep(1).
  • +<number> โ€” shows the first view with line number visible and selected.
  • -v, --version โ€” show version and exit. short and sweet โœจ
  • -h, --help โ€” show help message and exit. ๐Ÿซถ
  • -C <path> โ€” run as if tig was started in path instead of the current working directory.

๐ŸŒˆ PAGER MODE ๐ŸŒˆ

tig enters pager mode when input comes in via stdin. here's what she supports:

  • when the show subcommand is specified and the --stdin option is given, stdin is assumed to be a list of commit IDs and gets forwarded to the diff view's underlying git-show(1) command. for example:
$ git rev-list --author=vivien HEAD | tig show --stdin
  • when --stdin is given, stdin is assumed to be a list of commit IDs and gets forwarded to the main view's underlying git-log(1) command. for example:
$ tig --no-walk --stdin < cherry-picks.txt
  • when --pretty=raw is given, stdin is assumed to be a "pretty=raw" formatted output similar to that of git-log(1). for example:
$ git reflog --pretty=raw | tig --pretty=raw

and when no subcommands and no options are given? the pager view handles displaying the Git command input from stdin. the pager view assumes the input is either from git-log(1) or git-diff(1) and highlights it similar to the log and diff views. like:

$ git log -Schange -p --raw | tig

๐Ÿ“ EXAMPLES ๐Ÿ“

display the list of commits for the current branch:

$ tig

display commits from one or more branches:

$ tig test master

pretend as if all the refs in refs/ are listed on the command line:

$ tig --all

display differences between two branches:

$ tig test..master

display changes for sub-module versions:

$ tig --submodule

display changes for a single file:

$ tig -- README

display contents of the README file in a specific revision:

$ tig show tig-0.8:README

display revisions between two dates for a specific file:

$ tig --after="2004-01-01" --before="2006-05-16" -- README

blame file with copy detection enabled:

$ tig blame -C README

display the list of stashes:

$ tig stash

grep all files for lines containing DEFINE_ENUM:

$ tig grep -p DEFINE_ENUM

show references (branches, remotes and tags):

$ tig refs

use word diff in the diff view:

$ tig --word-diff=plain

๐Ÿฆ‹ ENVIRONMENT VARIABLES ๐Ÿฆ‹

on top of the environment variables Git uses (like GIT_DIR), tig defines the ones below. the command-related ones get access to tig's internal state via replacement variables, such as %(commit) and %(blob). full list lives in tigrc(5). ๐Ÿ“–

  • TIGRC_USER โ€” path of the user configuration file. defaults to ~/.tigrc or $XDG_CONFIG_HOME/tig/config.
  • TIGRC_SYSTEM โ€” path of the system wide configuration file. defaults to {sysconfdir}/tigrc. define it to an empty string to use the built-in configuration.
  • TIG_LS_REMOTE โ€” command for retrieving all repository references. the command should output data in the same format as git-ls-remote(1).
  • TIG_DIFF_OPTS โ€” the diff options to use in the diff view. the diff view uses git-show(1) for formatting and always passes --patch-with-stat. you may also set the diff-options setting in the configuration file.
  • TIG_TRACE โ€” path for the trace file where information about Git commands is logged.
  • TIG_SCRIPT โ€” path to a script that should be executed automatically on startup. if this environment variable is defined to the empty string, the script is read from stdin. the script is interpreted line-by-line and can contain prompt commands and key mappings. note that the < character must be encoded as <LT> within the script.

e.g.

TIG_SCRIPT=<(echo :set main-view-commit-title-graph = no) tig
  • TIG_NO_DISPLAY โ€” open tig without rendering anything to the terminal. this forces Ncurses to write to /dev/null. main use? automated testing of tig.
  • TIG_EDITOR โ€” the editor command to use when visiting files. this environment variable overrides (in order of precedence) $GIT_EDITOR, core.editor configuration, $VISUAL and $EDITOR, so it lets you use a different editor from the one Git uses. the value is meant to be interpreted by the shell when it is used.

๐Ÿงš FILES ๐Ÿงš

  • $XDG_CONFIG_HOME/tig/config, ~/.config/tig/config, ~/.tigrc โ€” the tig user configuration file is loaded like this: if $XDG_CONFIG_HOME is set, read user configuration from $XDG_CONFIG_HOME/tig/config. if $XDG_CONFIG_HOME is empty or undefined, read user configuration from ~/.config/tig/config if it exists, and fall back to ~/.tigrc if it does not exist. see tigrc(5) for examples.
  • /etc/tigrc โ€” system wide configuration file.
  • $GIT_DIR/config, ~/.gitconfig, /etc/gitconfig โ€” Git configuration files. read on start-up with the help of git-config(1).
  • $XDG_DATA_HOME/tig/history, ~/.local/share/tig/history, ~/.tig_history โ€” when compiled with readline support, tig writes a persistent command and search history. the location of the history file is determined like this: if $XDG_DATA_HOME is set and $XDG_DATA_HOME/ exists, create $XDG_DATA_HOME/tig/ if needed and store history to $XDG_DATA_HOME/tig/history. if $XDG_DATA_HOME is empty or undefined, store history to ~/.local/share/tig/history if the directory ~/.local/share/tig/ exists, and fall back to ~/.tig_history if it does not exist.

๐Ÿ’€ BUGS ๐Ÿ’€

please visit tig's home page for info about new releases and how to report bugs or feature requests. she wants your feedback bestie, she's listening ๐Ÿซถ


Copyright (c) 2006-2026 Jonas Fonseca <jonas.fonseca@gmail.com>

this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

tigrc(5), tigmanual(7), git(7)


๐Ÿ“ NOTES ๐Ÿ“

  1. home page https://github.com/jonas/tig
  2. jonas.fonseca@gmail.com mailto:jonas.fonseca@gmail.com

and that's the whole thing, bestie, you're officially tig-pilled ๐Ÿ’– this was Tig 2.6.1, dated 2026-06-13, and yeah โ€” you just read the entire TIG(1) manual. slay. go browse a repo. periodt ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from