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
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
170 In addition to environment variables used by Git (e.g. GIT_DIR), Tig
171 defines the ones below. The command related environment variables have
172 access to the internal state of Tig via replacement variables, such as
173 %(commit) and %(blob). See tigrc(5) for a full list.
174
175 TIGRC_USER
176 Path of the user configuration file (defaults to ~/.tigrc or
177 $XDG_CONFIG_HOME/tig/config).
178
179 TIGRC_SYSTEM
180 Path of the system wide configuration file (defaults to
181 {sysconfdir}/tigrc). Define to empty string to use built-in
182 configuration.
183
184 TIG_LS_REMOTE
185 Command for retrieving all repository references. The command
186 should output data in the same format as git-ls-remote(1).
187
188 TIG_DIFF_OPTS
189 The diff options to use in the diff view. The diff view uses
190 git-show(1) for formatting and always passes --patch-with-stat. You
191 may also set the diff-options setting in the configuration file.
192
193 TIG_TRACE
194 Path for trace file where information about Git commands are
195 logged.
196
197 TIG_SCRIPT
198 Path to script that should be executed automatically on startup. If
199 this environment variable is defined to the empty string, the
200 script is read from stdin. The script is interpreted line-by-line
201 and can contain prompt commands and key mappings.
202
203 TIG_NO_DISPLAY
204 Open Tig without rendering anything to the terminal. This force
205 Ncurses to write to /dev/null. The main use is for automated
206 testing of Tig.
207
209 $XDG_CONFIG_HOME/tig/config, ~/.config/tig/config, ~/.tigrc
210 The Tig user configuration file is loaded in the following way. If
211 $XDG_CONFIG_HOME is set, read user configuration from
212 $XDG_CONFIG_HOME/tig/config. If $XDG_CONFIG_HOME is empty or
213 undefined, read user configuration from ~/.config/tig/config if it
214 exists and fall back to ~/.tigrc if it does not exist. See tigrc(5)
215 for examples.
216
217 /etc/tigrc
218 System wide configuration file.
219
220 $GIT_DIR/config, ~/.gitconfig, /etc/gitconfig
221 Git configuration files. Read on start-up with the help of
222 git-config(1).
223
224 $XDG_DATA_HOME/tig/history, ~/.local/share/tig/history, ~/.tig_history
225 When compiled with readline support, Tig writes a persistent
226 command and search history. The location of the history file is
227 determined in the following way. If $XDG_DATA_HOME is set and
228 $XDG_DATA_HOME/tig/ exists, store history to
229 $XDG_DATA_HOME/tig/history. If $XDG_DATA_HOME is empty or
230 undefined, store history to ~/.local/share/tig/history if the
231 directory ~/.local/share/tig/ exists, and fall back to
232 ~/.tig_history if it does not exist.
233
235 Please visit Tig’s home page[1] or main Git repository[2] for
236 information about new releases and how to report bugs or feature
237 request.
238
240 Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com[3]>
241
242 This program is free software; you can redistribute it and/or modify it
243 under the terms of the GNU General Public License as published by the
244 Free Software Foundation; either version 2 of the License, or (at your
245 option) any later version.
246
248 tigrc(5), tigmanual(7), git(7)
249
251 1. home page
252 https://jonas.github.io/tig
253
254 2. main Git repository
255 https://github.com/jonas/tig
256
257 3. jonas.fonseca@gmail.com
258 mailto:jonas.fonseca@gmail.com
259
260
261
262Tig 2.5.0 11/16/2019 TIG(1)