tig - text-mode interface for Git
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]
Tig is an ncurses-based text-mode interface for git(1). It functions mainly as a Git repository browser, but can also assist in staging changes for commit at chunk level and act as a pager for output from various Git commands.
Command line options recognized by Tig include all valid git-log(1) and git-diff(1) options, as well as the following subcommands and Tig-specific options. The first command line parameter not starting with "-" is interpreted as being either a revision specification or a path and will end the option parsing. All additional options will be passed to the underlying Git command.
Note that this means that any arguments to options should be specified together. For example, run tig -Sfoo instead of tig -S foo, and tig --grep=foo instead of tig --grep foo, otherwise foo will be interpreted as a revision rather than an argument.
Tig enters pager mode when input is provided via stdin and supports the following subcommands and options:
$ git rev-list --author=vivien HEAD | tig show --stdin
$ tig --no-walk --stdin < cherry-picks.txt
$ git reflog --pretty=raw | tig --pretty=raw
When no subcommands nor options are given, the pager view will be used for displaying the Git command input given on stdin. The pager view assumes the input is either from git-log(1) or git-diff(1) and will highlight it similar to the log and diff views. For example:
$ git log -Schange -p --raw | tig
Display the list of commits for the current branch:
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
In addition to environment variables used by Git (e.g. GIT_DIR), Tig defines the ones below. The command related environment variables have access to the internal state of Tig via replacement variables, such as %(commit) and %(blob). See tigrc(5) for a full list.
E.g. TIG_SCRIPT=<(echo :set main-view-commit-title-graph = no) tig
$XDG_CONFIG_HOME/tig/config, ~/.config/tig/config, ~/.tigrc
$GIT_DIR/config, ~/.gitconfig, /etc/gitconfig
$XDG_DATA_HOME/tig/history, ~/.local/share/tig/history, ~/.tig_history
Please visit Tig’s home page or main Git repository for information about new releases and how to report bugs or feature request.
Copyright (c) 2006-2022 Jonas Fonseca <email@example.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.
- home page
- main Git repository