8 tig - text-mode interface for Git
13 _______________________________________________________________________
14 tig [options] [revisions] [--] [paths]
15 tig log [options] [revisions] [--] [paths]
16 tig show [options] [revisions] [--] [paths]
17 tig blame [options] [rev] [--] path
18 tig grep [options] [pattern]
22 tig < [Git command output]
23 _______________________________________________________________________
28 Tig is an ncurses-based text-mode interface for git(1). It functions
29 mainly as a Git repository browser, but can also assist in staging
30 changes for commit at chunk level and act as a pager for output from
36 Command line options recognized by Tig include all valid git-log(1) and
37 git-diff(1) options, as well as the following subcommands and Tig specific
38 options. The first command line parameter not starting with "-" is interpreted
39 as being either a revision specification or a path and will end the option
40 parsing. All additional options will be passed to the underlying Git command.
43 Open diff view using the given git-show(1) options.
46 Show given file annotated by commits.
47 Takes zero or more git-blame(1) options.
48 Optionally limited from given revision.
51 Start up in status view.
54 Start up in log view, displaying git-log(1) output.
57 Start up in refs view.
60 Start up in stash view.
63 Open the grep view. Supports the same options as git-grep(1).
66 Show the first view with line <number> visible and selected.
69 Show version and exit.
72 Show help message and exit.
77 Tig enters pager mode when input is provided via stdin and supports the
78 following subcommands and options:
82 - When the 'show' subcommand is specified and the '--stdin' option is given,
83 stdin is assumed to be a list of commit IDs and will be forwarded to the diff
84 view's underlying git-show(1) command. For example:
86 -----------------------------------------------------------------------------
87 $ git rev-list --author=vivien HEAD | tig show --stdin
88 -----------------------------------------------------------------------------
90 - When '--stdin' is given, stdin is assumed to be a list of commit IDs
91 and will be forwarded to the main view's underlying git-log(1)
94 -----------------------------------------------------------------------------
95 $ tig --no-walk --stdin < cherry-picks.txt
96 -----------------------------------------------------------------------------
98 - When '--pretty=raw' is given, stdin is assumed to be a "pretty=raw"
99 formatted output similar to that of git-log(1). For example:
101 -----------------------------------------------------------------------------
102 $ git reflog --pretty=raw | tig --pretty=raw
103 -----------------------------------------------------------------------------
107 When no subcommands nor options are given, the pager view will be used for
108 displaying the Git command input given on stdin. The pager view assumes the
109 input is either from git-log(1) or git-diff(1) and will highlight it similar to
110 the log and diff views. For example:
112 -----------------------------------------------------------------------------
113 $ git log -Schange -p --raw | tig
114 -----------------------------------------------------------------------------
119 Display the list of commits for the current branch:
120 -----------------------------------------------------------------------------
122 -----------------------------------------------------------------------------
124 Display commits from one or more branches:
125 -----------------------------------------------------------------------------
127 -----------------------------------------------------------------------------
129 Display all branches:
130 -----------------------------------------------------------------------------
132 -----------------------------------------------------------------------------
134 Display differences between two branches:
135 -----------------------------------------------------------------------------
137 -----------------------------------------------------------------------------
139 Display changes for sub-module versions:
140 -----------------------------------------------------------------------------
142 -----------------------------------------------------------------------------
144 Display changes for a single file:
145 -----------------------------------------------------------------------------
147 -----------------------------------------------------------------------------
149 Display contents of the README file in a specific revision:
150 -----------------------------------------------------------------------------
151 $ tig show tig-0.8:README
152 -----------------------------------------------------------------------------
154 Display revisions between two dates for a specific file:
155 -----------------------------------------------------------------------------
156 $ tig --after="2004-01-01" --before="2006-05-16" -- README
157 -----------------------------------------------------------------------------
159 Blame file with copy detection enabled:
160 -----------------------------------------------------------------------------
161 $ tig blame -C README
162 -----------------------------------------------------------------------------
164 Display the list of stashes:
165 -----------------------------------------------------------------------------
167 -----------------------------------------------------------------------------
169 Grep all files for lines containing `DEFINE_ENUM`:
170 -----------------------------------------------------------------------------
171 $ tig grep -p DEFINE_ENUM
172 -----------------------------------------------------------------------------
174 Show references (branches, remotes and tags):
175 -----------------------------------------------------------------------------
177 -----------------------------------------------------------------------------
179 ENVIRONMENT VARIABLES
180 ---------------------
182 In addition to environment variables used by Git (e.g. GIT_DIR), Tig defines
183 the ones below. The command related environment variables have access to the
184 internal state of Tig via replacement variables, such as `%(commit)` and
187 See manpage:tigrc[5] for a full list.
190 See link:tigrc.5.{docext}[tigrc(5)] for a full list.
194 Path of the user configuration file (defaults to `~/.tigrc`).
197 Path of the system wide configuration file (defaults to
198 `{sysconfdir}/tigrc`). Define to empty string to use built-in
202 Set command for retrieving all repository references. The command
203 should output data in the same format as git-ls-remote(1).
206 The diff options to use in the diff view. The diff view uses
207 git-show(1) for formatting and always passes --patch-with-stat. You
208 may also set the `diff-options` setting in the configuration file.
211 Path for trace file where information about Git commands are logged.
214 Path to script that should be executed automatically on startup. If this
215 environment variable is defined to the empty string, the script is read
216 from stdin. The script is interpreted line-by-line and can contain
217 prompt commands and key mappings.
220 Open Tig without rendering anything to the terminal. This force Ncurses
221 to write to /dev/null. The main use is for automated testing of Tig.
225 '$XDG_CONFIG_HOME/tig/config::
226 '~/.config/tig/config'::
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
233 manpage:tigrc[5] for examples.
235 '{sysconfdir}/tigrc'::
236 System wide configuration file.
240 '{sysconfdir}/gitconfig::
241 Git configuration files. Read on start-up with the help of
247 Please visit Tig's http://jonas.nitro.dk/tig[home page] or
248 https://github.com/jonas/tig[main Git repository] for information about
249 new releases and how to report bugs or feature request.
253 Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
255 This program is free software; you can redistribute it and/or modify
256 it under the terms of the GNU General Public License as published by
257 the Free Software Foundation; either version 2 of the License, or
258 (at your option) any later version.
262 ifndef::backend-docbook[]
263 link:tigrc.5.{docext}[tigrc(5)],
264 link:manual.{docext}[the Tig manual],
265 endif::backend-docbook[]
266 ifdef::backend-docbook[]
268 manpage:tigmanual[7],
269 endif::backend-docbook[]