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