1TIG(1) Tig Manual TIG(1)
2
3
4
6 tig - text-mode interface for Git
7
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
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
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 Note that this means that any arguments to options should be specified
36 together. For example, run tig -Sfoo instead of tig -S foo, and tig
37 --grep=foo instead of tig --grep foo, otherwise foo will be interpreted
38 as a revision rather than an argument.
39
40 show
41 Open diff view using the given git-show(1) options.
42
43 blame
44 Show given file annotated by commits. Takes zero or more
45 git-blame(1) options. Optionally limited from given revision.
46
47 status
48 Start up in status view.
49
50 log
51 Start up in log view, displaying git-log(1) output.
52
53 reflog
54 Start up in reflog view.
55
56 refs
57 Start up in refs view. All refs are displayed unless limited by
58 using one of the --branches, --remotes, or --tags parameters.
59
60 stash
61 Start up in stash view.
62
63 grep
64 Open the grep view. Supports the same options as git-grep(1).
65
66 +<number>
67 Show the first view with line <number> visible and selected.
68
69 -v, --version
70 Show version and exit.
71
72 -h, --help
73 Show help message and exit.
74
75 -C <path>
76 Run as if Tig was started in <path> instead of the current working
77 directory.
78
80 Tig enters pager mode when input is provided via stdin and supports the
81 following subcommands and options:
82
83 • When the show subcommand is specified and the --stdin option is
84 given, stdin is assumed to be a list of commit IDs and will be
85 forwarded to the diff view’s underlying git-show(1) command. For
86 example:
87
88 $ git rev-list --author=vivien HEAD | tig show --stdin
89
90
91
92 • When --stdin is given, stdin is assumed to be a list of commit IDs
93 and will be forwarded to the main view’s underlying git-log(1)
94 command. For example:
95
96 $ tig --no-walk --stdin < cherry-picks.txt
97
98
99
100 • When --pretty=raw is given, stdin is assumed to be a "pretty=raw"
101 formatted output similar to that of git-log(1). For example:
102
103 $ git reflog --pretty=raw | tig --pretty=raw
104
105
106 When no subcommands nor options are given, the pager view will be used
107 for displaying the Git command input given on stdin. The pager view
108 assumes the input is either from git-log(1) or git-diff(1) and will
109 highlight it similar to the log and diff views. For example:
110
111 $ git log -Schange -p --raw | tig
112
113
115 Display the list of commits for the current branch:
116
117 $ tig
118
119
120 Display commits from one or more branches:
121
122 $ tig test master
123
124
125 Pretend as if all the refs in refs/ are listed on the command line:
126
127 $ tig --all
128
129
130 Display differences between two branches:
131
132 $ tig test..master
133
134
135 Display changes for sub-module versions:
136
137 $ tig --submodule
138
139
140 Display changes for a single file:
141
142 $ tig -- README
143
144
145 Display contents of the README file in a specific revision:
146
147 $ tig show tig-0.8:README
148
149
150 Display revisions between two dates for a specific file:
151
152 $ tig --after="2004-01-01" --before="2006-05-16" -- README
153
154
155 Blame file with copy detection enabled:
156
157 $ tig blame -C README
158
159
160 Display the list of stashes:
161
162 $ tig stash
163
164
165 Grep all files for lines containing DEFINE_ENUM:
166
167 $ tig grep -p DEFINE_ENUM
168
169
170 Show references (branches, remotes and tags):
171
172 $ tig refs
173
174
175 Use word diff in the diff view:
176
177 $ tig --word-diff=plain
178
179
181 In addition to environment variables used by Git (e.g. GIT_DIR), Tig
182 defines the ones below. The command related environment variables have
183 access to the internal state of Tig via replacement variables, such as
184 %(commit) and %(blob). See tigrc(5) for a full list.
185
186 TIGRC_USER
187 Path of the user configuration file (defaults to ~/.tigrc or
188 $XDG_CONFIG_HOME/tig/config).
189
190 TIGRC_SYSTEM
191 Path of the system wide configuration file (defaults to
192 {sysconfdir}/tigrc). Define to empty string to use built-in
193 configuration.
194
195 TIG_LS_REMOTE
196 Command for retrieving all repository references. The command
197 should output data in the same format as git-ls-remote(1).
198
199 TIG_DIFF_OPTS
200 The diff options to use in the diff view. The diff view uses
201 git-show(1) for formatting and always passes --patch-with-stat. You
202 may also set the diff-options setting in the configuration file.
203
204 TIG_TRACE
205 Path for trace file where information about Git commands are
206 logged.
207
208 TIG_SCRIPT
209 Path to script that should be executed automatically on startup. If
210 this environment variable is defined to the empty string, the
211 script is read from stdin. The script is interpreted line-by-line
212 and can contain prompt commands and key mappings.
213
214 E.g. TIG_SCRIPT=<(echo :set main-view-commit-title-graph = no) tig
215
216 TIG_NO_DISPLAY
217 Open Tig without rendering anything to the terminal. This force
218 Ncurses to write to /dev/null. The main use is for automated
219 testing of Tig.
220
221 TIG_EDITOR
222 The editor command to use when visiting files. This environment
223 variable overrides $GIT_EDITOR, $EDITOR and $VISUAL, so it allows
224 to use a different editor from the one Git uses.
225
227 $XDG_CONFIG_HOME/tig/config, ~/.config/tig/config, ~/.tigrc
228 The Tig user configuration file is loaded in the following way. If
229 $XDG_CONFIG_HOME is set, read user configuration from
230 $XDG_CONFIG_HOME/tig/config. If $XDG_CONFIG_HOME is empty or
231 undefined, read user configuration from ~/.config/tig/config if it
232 exists and fall back to ~/.tigrc if it does not exist. See tigrc(5)
233 for examples.
234
235 /etc/tigrc
236 System wide configuration file.
237
238 $GIT_DIR/config, ~/.gitconfig, /etc/gitconfig
239 Git configuration files. Read on start-up with the help of
240 git-config(1).
241
242 $XDG_DATA_HOME/tig/history, ~/.local/share/tig/history, ~/.tig_history
243 When compiled with readline support, Tig writes a persistent
244 command and search history. The location of the history file is
245 determined in the following way. If $XDG_DATA_HOME is set and
246 $XDG_DATA_HOME/ exists, create $XDG_DATA_HOME/tig/ if needed and
247 store history to $XDG_DATA_HOME/tig/history. If $XDG_DATA_HOME is
248 empty or undefined, store history to ~/.local/share/tig/history if
249 the directory ~/.local/share/tig/ exists, and fall back to
250 ~/.tig_history if it does not exist.
251
253 Please visit Tig’s home page[1] or main Git repository[2] for
254 information about new releases and how to report bugs or feature
255 request.
256
258 Copyright (c) 2006-2022 Jonas Fonseca <jonas.fonseca@gmail.com[3]>
259
260 This program is free software; you can redistribute it and/or modify it
261 under the terms of the GNU General Public License as published by the
262 Free Software Foundation; either version 2 of the License, or (at your
263 option) any later version.
264
266 tigrc(5), tigmanual(7), git(7)
267
269 1. home page
270 https://jonas.github.io/tig
271
272 2. main Git repository
273 https://github.com/jonas/tig
274
275 3. jonas.fonseca@gmail.com
276 mailto:jonas.fonseca@gmail.com
277
278
279
280Tig 2.5.8 02/04/2023 TIG(1)