---
name: "tig"
section: "1"
platform: "linux"
package: "tig"
version: "2.6.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/tig"
---

# tig(1)

text-mode interface for Git

## NAME

tig - text-mode interface for Git

## 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]
```

## DESCRIPTION

Tig is an ncurses-based text-mode interface for [git(1)](/git/1.md). 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.

## OPTIONS

Command line options recognized by Tig include all valid [git-log(1)](/git-log/1.md) and [git-diff(1)](/git-diff/1.md) 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.

show

Open diff view using the given [git-show(1)](/git-show/1.md) options.

blame

Show given file annotated by commits. Takes zero or more [git-blame(1)](/git-blame/1.md) options. Optionally limited from given revision.

status

Start up in status view.

log

Start up in log view, displaying [git-log(1)](/git-log/1.md) output.

reflog

Start up in reflog view.

refs

Start up in refs view. All refs are displayed unless limited by using one of the *--branches*, *--remotes*, or *--tags* parameters.

stash

Start up in stash view.

grep

Open the grep view. Supports the same options as [git-grep(1)](/git-grep/1.md).

\+\<number\>

Show the first view with line \<number\> visible and selected.

- \-v, --version

  Show version and exit.

- \-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 is provided via stdin and supports the following subcommands and options:

• When the *show* subcommand is specified and the *--stdin* option is given, stdin is assumed to be a list of commit IDs and will be forwarded to the diff view’s underlying [git-show(1)](/git-show/1.md) 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 will be forwarded to the main view’s underlying [git-log(1)](/git-log/1.md) 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)](/git-log/1.md). For example:

```
$ 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)](/git-log/1.md) or [git-diff(1)](/git-diff/1.md) and will highlight it similar to the log and diff views. For example:

```
$ 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

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)](/tigrc/5.md) for a full list.

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 to empty string to use 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)](/git-ls-remote/1.md).

TIG\_DIFF\_OPTS

The diff options to use in the diff view. The diff view uses [git-show(1)](/git-show/1.md) for formatting and always passes --patch-with-stat. You may also set the diff-options setting in the configuration file.

TIG\_TRACE

Path for trace file where information about Git commands are logged.

TIG\_SCRIPT

Path to 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 force Ncurses to write to /dev/null. The main use is for 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 allows to 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 in the following way. 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)](/tigrc/5.md) 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)](/git-config/1.md).

*$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 in the following way. 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**\[1\] for information about new releases and how to report bugs or feature request.

## COPYRIGHT

Copyright (c) 2006-2026 Jonas Fonseca \<**jonas.fonseca@gmail.com**\[2\]\>

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)](/tigrc/5.md), [**tigmanual**(7)](/tigmanual/7.md), [git(7)](/git/7.md)

## NOTES

- 1\.

  home page

  https://github.com/jonas/tig

- 2\.

  jonas.fonseca@gmail.com

  mailto:jonas.fonseca@gmail.com
