1TIG(1)                            Tig Manual                            TIG(1)
2
3
4

NAME

6       tig - text-mode interface for Git
7

SYNOPSIS

9       tig        [options] [revisions] [--] [paths]
10       tig log    [options] [revisions] [--] [paths]
11       tig show   [options] [revisions] [--] [paths]
12       tig reflog [options] [revisions]
13       tig blame  [options] [rev] [--] path
14       tig grep   [options] [pattern]
15       tig refs   [options]
16       tig stash  [options]
17       tig status
18       tig <      [Git command output]
19
20

DESCRIPTION

22       Tig is an ncurses-based text-mode interface for git(1). It functions
23       mainly as a Git repository browser, but can also assist in staging
24       changes for commit at chunk level and act as a pager for output from
25       various Git commands.
26

OPTIONS

28       Command line options recognized by Tig include all valid git-log(1) and
29       git-diff(1) options, as well as the following subcommands and
30       Tig-specific options. The first command line parameter not starting
31       with "-" is interpreted as being either a revision specification or a
32       path and will end the option parsing. All additional options will be
33       passed to the underlying Git command.
34
35       show
36           Open diff view using the given git-show(1) options.
37
38       blame
39           Show given file annotated by commits. Takes zero or more
40           git-blame(1) options. Optionally limited from given revision.
41
42       status
43           Start up in status view.
44
45       log
46           Start up in log view, displaying git-log(1) output.
47
48       reflog
49           Start up in reflog view.
50
51       refs
52           Start up in refs view. All refs are displayed unless limited by
53           using one of the --branches, --remotes, or --tags parameters.
54
55       stash
56           Start up in stash view.
57
58       grep
59           Open the grep view. Supports the same options as git-grep(1).
60
61       +<number>
62           Show the first view with line <number> visible and selected.
63
64       -v, --version
65           Show version and exit.
66
67       -h, --help
68           Show help message and exit.
69
70       -C <path>
71           Run as if Tig was started in <path> instead of the current working
72           directory.
73

PAGER MODE

75       Tig enters pager mode when input is provided via stdin and supports the
76       following subcommands and options:
77
78       •   When the show subcommand is specified and the --stdin option is
79           given, stdin is assumed to be a list of commit IDs and will be
80           forwarded to the diff view’s underlying git-show(1) command. For
81           example:
82
83           $ git rev-list --author=vivien HEAD | tig show --stdin
84
85
86
87       •   When --stdin is given, stdin is assumed to be a list of commit IDs
88           and will be forwarded to the main view’s underlying git-log(1)
89           command. For example:
90
91           $ tig --no-walk --stdin < cherry-picks.txt
92
93
94
95       •   When --pretty=raw is given, stdin is assumed to be a "pretty=raw"
96           formatted output similar to that of git-log(1). For example:
97
98           $ git reflog --pretty=raw | tig --pretty=raw
99
100
101       When no subcommands nor options are given, the pager view will be used
102       for displaying the Git command input given on stdin. The pager view
103       assumes the input is either from git-log(1) or git-diff(1) and will
104       highlight it similar to the log and diff views. For example:
105
106           $ git log -Schange -p --raw | tig
107
108

EXAMPLES

110       Display the list of commits for the current branch:
111
112           $ tig
113
114
115       Display commits from one or more branches:
116
117           $ tig test master
118
119
120       Pretend as if all the refs in refs/ are listed on the command line:
121
122           $ tig --all
123
124
125       Display differences between two branches:
126
127           $ tig test..master
128
129
130       Display changes for sub-module versions:
131
132           $ tig --submodule
133
134
135       Display changes for a single file:
136
137           $ tig -- README
138
139
140       Display contents of the README file in a specific revision:
141
142           $ tig show tig-0.8:README
143
144
145       Display revisions between two dates for a specific file:
146
147           $ tig --after="2004-01-01" --before="2006-05-16" -- README
148
149
150       Blame file with copy detection enabled:
151
152           $ tig blame -C README
153
154
155       Display the list of stashes:
156
157           $ tig stash
158
159
160       Grep all files for lines containing DEFINE_ENUM:
161
162           $ tig grep -p DEFINE_ENUM
163
164
165       Show references (branches, remotes and tags):
166
167           $ tig refs
168
169
170       Use word diff in the diff view:
171
172           $ tig --word-diff=plain
173
174

ENVIRONMENT VARIABLES

176       In addition to environment variables used by Git (e.g. GIT_DIR), Tig
177       defines the ones below. The command related environment variables have
178       access to the internal state of Tig via replacement variables, such as
179       %(commit) and %(blob). See tigrc(5) for a full list.
180
181       TIGRC_USER
182           Path of the user configuration file (defaults to ~/.tigrc or
183           $XDG_CONFIG_HOME/tig/config).
184
185       TIGRC_SYSTEM
186           Path of the system wide configuration file (defaults to
187           {sysconfdir}/tigrc). Define to empty string to use built-in
188           configuration.
189
190       TIG_LS_REMOTE
191           Command for retrieving all repository references. The command
192           should output data in the same format as git-ls-remote(1).
193
194       TIG_DIFF_OPTS
195           The diff options to use in the diff view. The diff view uses
196           git-show(1) for formatting and always passes --patch-with-stat. You
197           may also set the diff-options setting in the configuration file.
198
199       TIG_TRACE
200           Path for trace file where information about Git commands are
201           logged.
202
203       TIG_SCRIPT
204           Path to script that should be executed automatically on startup. If
205           this environment variable is defined to the empty string, the
206           script is read from stdin. The script is interpreted line-by-line
207           and can contain prompt commands and key mappings.
208
209               E.g. TIG_SCRIPT=<(echo :set main-view-commit-title-graph = no) tig
210
211       TIG_NO_DISPLAY
212           Open Tig without rendering anything to the terminal. This force
213           Ncurses to write to /dev/null. The main use is for automated
214           testing of Tig.
215
216       TIG_EDITOR
217           The editor command to use when visiting files. This environment
218           variable overrides $GIT_EDITOR, $EDITOR and $VISUAL, so it allows
219           to use a different editor from the one Git uses.
220

FILES

222       $XDG_CONFIG_HOME/tig/config, ~/.config/tig/config, ~/.tigrc
223           The Tig user configuration file is loaded in the following way. If
224           $XDG_CONFIG_HOME is set, read user configuration from
225           $XDG_CONFIG_HOME/tig/config. If $XDG_CONFIG_HOME is empty or
226           undefined, read user configuration from ~/.config/tig/config if it
227           exists and fall back to ~/.tigrc if it does not exist. See tigrc(5)
228           for examples.
229
230       /etc/tigrc
231           System wide configuration file.
232
233       $GIT_DIR/config, ~/.gitconfig, /etc/gitconfig
234           Git configuration files. Read on start-up with the help of
235           git-config(1).
236
237       $XDG_DATA_HOME/tig/history, ~/.local/share/tig/history, ~/.tig_history
238           When compiled with readline support, Tig writes a persistent
239           command and search history. The location of the history file is
240           determined in the following way. If $XDG_DATA_HOME is set and
241           $XDG_DATA_HOME/ exists, create $XDG_DATA_HOME/tig/ if needed and
242           store history to $XDG_DATA_HOME/tig/history. If $XDG_DATA_HOME is
243           empty or undefined, store history to ~/.local/share/tig/history if
244           the directory ~/.local/share/tig/ exists, and fall back to
245           ~/.tig_history if it does not exist.
246

BUGS

248       Please visit Tig’s home page[1] or main Git repository[2] for
249       information about new releases and how to report bugs or feature
250       request.
251
253       Copyright (c) 2006-2022 Jonas Fonseca <jonas.fonseca@gmail.com[3]>
254
255       This program is free software; you can redistribute it and/or modify it
256       under the terms of the GNU General Public License as published by the
257       Free Software Foundation; either version 2 of the License, or (at your
258       option) any later version.
259

SEE ALSO

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

NOTES

264        1. home page
265           https://jonas.github.io/tig
266
267        2. main Git repository
268           https://github.com/jonas/tig
269
270        3. jonas.fonseca@gmail.com
271           mailto:jonas.fonseca@gmail.com
272
273
274
275Tig 2.5.7                         08/25/2022                            TIG(1)
Impressum