1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 7.0.2" />
7 <style type=
"text/css">
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border:
1px solid red;
16 margin:
1em
5%
1em
5%;
20 a:visited { color: fuchsia; }
34 h1, h2, h3, h4, h5, h6 {
36 font-family: sans-serif;
43 border-bottom:
2px solid silver;
46 border-bottom:
2px solid silver;
56 border:
1px solid silver;
71 font-family: sans-serif;
78 font-family: sans-serif;
82 font-family: sans-serif;
84 border-top:
2px solid silver;
90 padding-bottom:
0.5em;
94 padding-bottom:
0.5em;
98 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100 div.admonitionblock {
103 margin-bottom:
1.5em;
105 div.admonitionblock {
107 margin-bottom:
2.5em;
110 div.content { /* Block element content. */
114 /* Block element titles. */
115 div.title, caption.title {
116 font-family: sans-serif;
120 margin-bottom:
0.5em;
126 td div.title:first-child {
129 div.content div.title:first-child {
132 div.content + div.title {
136 div.sidebarblock
> div.content {
138 border:
1px solid silver;
142 div.listingblock
> div.content {
143 border:
1px solid silver;
148 div.quoteblock
> div.content {
151 div.quoteblock .attribution {
155 div.admonitionblock .icon {
159 text-decoration: underline;
161 padding-right:
0.5em;
163 div.admonitionblock td.content {
165 border-left:
2px solid silver;
168 div.exampleblock
> div.content {
169 border-left:
2px solid silver;
173 div.verseblock div.content {
177 div.imageblock div.content { padding-left:
0; }
178 div.imageblock img { border:
1px solid silver; }
179 span.image img { border-style: none; }
183 margin-bottom:
0.8em;
195 list-style-position: outside;
198 list-style-type: lower-alpha;
201 div.tableblock
> table {
202 border-color: #
527bbd;
206 font-family: sans-serif;
215 margin-bottom:
0.8em;
220 padding-right:
0.8em;
227 div#footer-badges { display: none; }
229 /* Workarounds for IE6's broken and incomplete CSS2. */
231 div.sidebar-content {
233 border:
1px solid silver;
236 div.sidebar-title, div.image-title {
237 font-family: sans-serif;
240 margin-bottom:
0.5em;
243 div.listingblock div.content {
244 border:
1px solid silver;
249 div.quoteblock-content {
253 div.exampleblock-content {
254 border-left:
2px solid silver;
258 <title>The tig Manual
</title>
262 <h1>The tig Manual
</h1>
263 <span id=
"author">Jonas Fonseca
</span><br />
264 <span id=
"email"><tt><<a href=
"mailto:fonseca@diku.dk">fonseca@diku.dk
</a>></tt></span><br />
267 <div class=
"sectionbody">
268 <p>This is the manual for tig, the ncurses-based text-mode interface for git.
269 Tig allows you to browse changes in a git repository and can additionally act
270 as a pager for output of various git commands. When used as a pager, it will
271 display input from stdin and colorize it.
</p>
272 <p>When browsing repositories, tig uses the underlying git commands to present
273 the user with various views, such as summarized commit log and showing the
274 commit with the log message, diffstat, and the diff.
</p>
277 <h2>Calling Conventions
</h2>
278 <div class=
"sectionbody">
280 <p>If stdin is a pipe, any log or diff options will be ignored and the pager view
281 will be opened loading data from stdin. The pager mode can be used for
282 colorizing output from various git commands.
</p>
283 <p>Example on how to colorize the output of git-show(
1):
</p>
284 <div class=
"literalblock">
285 <div class=
"content">
286 <pre><tt>$ git show | tig
</tt></pre>
288 <h3>Git Command Options
</h3>
289 <p>All git command options specified on the command line will be passed to the
290 given command and all will be shell quoted before they are passed to the
292 <div class=
"admonitionblock">
295 <div class=
"title">Note
</div>
297 <td class=
"content">If you specify options for the main view, you should not use the
298 <tt>—pretty
</tt> option as this option will be set automatically to the format
299 expected by the main view.
</td>
302 <p>Example on how to open the log view and show both author and committer
304 <div class=
"literalblock">
305 <div class=
"content">
306 <pre><tt>$ tig log --pretty=fuller
</tt></pre>
308 <p>See the
<a href=
"#refspec">"Specifying revisions"</a> section below for an introduction
309 to revision options supported by the git commands. For details on specific git
310 command options, refer to the man page of the command in question.
</p>
312 <h2>Environment Variables
</h2>
313 <div class=
"sectionbody">
314 <p>Several options related to the interface with git can be configured via
315 environment options.
</p>
316 <h3>Repository References
</h3>
317 <p>Commits that are referenced by tags and branch heads will be marked by the
318 reference name surrounded by
<em>[
</em> and
<em>]
</em>:
</p>
319 <div class=
"literalblock">
320 <div class=
"content">
321 <pre><tt>2006-
03-
26 19:
42 Petr Baudis | [cogito-
0.17.1] Cogito
0.17.1</tt></pre>
323 <p>If you want to filter out certain directories under
<tt>.git/refs/
</tt>, say
<tt>tmp
</tt>
324 you can do it by setting the following variable:
</p>
325 <div class=
"literalblock">
326 <div class=
"content">
327 <pre><tt>$
TIG_LS_REMOTE=
"git ls-remote . | sed /\/tmp\//d" tig
</tt></pre>
329 <p>Or set the variable permanently in your environment.
</p>
336 Set command for retrieving all repository references. The command
337 should output data in the same format as git-ls-remote(
1).
341 <h3><a id=
"history-commands"></a>History Commands
</h3>
342 <p>It is possible to alter which commands are used for the different views. If
343 for example you prefer commits in the main view to be sorted by date and only
344 show
500 commits, use:
</p>
345 <div class=
"literalblock">
346 <div class=
"content">
347 <pre><tt>$
TIG_MAIN_CMD=
"git log --date-order -n500 --pretty=raw %s" tig
</tt></pre>
349 <p>Or set the variable permanently in your environment.
</p>
350 <p>Notice, how
<tt>%s
</tt> is used to specify the commit reference. There can be a
351 maximum of
5 <tt>%s
</tt> ref specifications.
</p>
358 The command used for the diff view. By default, git show is used
367 The command used for the log view. If you prefer to have both
368 author and committer shown in the log view be sure to pass
369 <tt>—pretty=fuller
</tt> to git log.
377 The command used for the main view. Note, you must always specify
378 the option:
<tt>—pretty=raw
</tt> since the main view parser expects to
385 <div class=
"sectionbody">
386 <p>The display consists of a status window on the last line of the screen and one
387 or more views. The default is to only show one view at the time but it is
388 possible to split both the main and log view to also show the commit diff.
</p>
389 <p>If you are in the log view and press
<em>Enter
</em> when the current line is a commit
391 <div class=
"literalblock">
392 <div class=
"content">
393 <pre><tt>commit
4d55caff4cc89335192f3e566004b4ceef572521
</tt></pre>
395 <p>You will split the view so that the log view is displayed in the top window
396 and the diff view in the bottom window. You can switch between the two views
397 by pressing
<em>Tab
</em>. To maximize the log view again, simply press
<em>l
</em>.
</p>
398 <h3>Current Head and Commit ID
</h3>
399 <p>The viewer keeps track of both what head and commit ID you are currently
400 viewing. The commit ID will follow the cursor line and change everytime time
401 you highlight a different commit. Whenever you reopen the diff view it will be
402 reloaded, if the commit ID changed.
</p>
403 <p>The head ID is used when opening the main and log view to indicate from what
404 revision to show history.
</p>
406 <p>tig(
1) presents various
<em>views
</em> of a repository. Each view is based on output
407 from an external command, most often
<em>git log
</em>,
<em>git diff
</em>, or
<em>git show
</em>.
</p>
414 Is the default view, and it shows a one line summary of each commit
415 in the chosen list of revisions. The summary includes commit date,
416 author, and the first line of the log message. Additionally, any
417 repository references, such as tags, will be shown.
425 Presents a more rich view of the revision log showing the whole log
426 message and the diffstat.
434 Shows either the diff of the current working tree, that is, what
435 has changed since the last commit, or the commit diff complete
436 with log message, diffstat and diff.
444 Is used for displaying both input from stdin and output from git
445 commands entered in the internal prompt.
453 Displays key binding quick reference.
457 <h3>Title Windows
</h3>
458 <p>Each view has a title window which shows the name of the view, current commit
459 ID if available, and where the view is positioned:
</p>
460 <div class=
"literalblock">
461 <div class=
"content">
462 <pre><tt>[main] c622eefaa485995320bc743431bae0d497b1d875 - commit
1 of
61 (
1%)
</tt></pre>
464 <p>By default, the title of the current view is highlighted using bold font. For
465 long loading views (taking over
3 seconds) the time since loading started will
467 <div class=
"literalblock">
468 <div class=
"content">
469 <pre><tt>[main]
77d9e40fbcea3238015aea403e06f61542df9a31 - commit
1 of
779 (
0%)
5s
</tt></pre>
473 <div class=
"sectionbody">
474 <p>Below the default key bindings are shown.
</p>
475 <h3>View Switching
</h3>
506 Switch to pager view.
518 <h3>View Manipulation
</h3>
525 Close view, if multiple views are open it will jump back to the
526 previous view in the view stack. If it is the last open view it
527 will quit. Use
<em>Q
</em> to quit all views at once.
535 This key is
"context sensitive" depending on what view you are
536 currently in. When in log view on a commit line or in the main
537 view, split the view and show the commit diff. In the diff view
538 pressing Enter will simply scroll the view one line down.
554 This key is
"context sensitive" and will move the cursor one
555 line up. However, uf you opened a diff view from the main view
556 (split- or full-screen) it will change the cursor to point to
557 the previous commit in the main view and update the diff view
566 Similar to
<em>Up
</em> but will move down.
570 <h3>Cursor Navigation
</h3>
577 Move cursor one line up.
585 Move cursor one line down.
599 Move cursor one page up.
610 Move cursor one page down.
637 Scroll view one line up.
645 Scroll view one line down.
653 Scroll view one page up.
661 Scroll view one page down.
688 Stop all background loading. This can be useful if you use
689 tig(
1) in a repository with a long history without limiting
706 Toggle line numbers on/off.
714 Toggle revision graph visualization on/off.
722 Open prompt. This allows you to specify what git command
725 <div class=
"literalblock">
726 <div class=
"content">
727 <pre><tt>:log -p
</tt></pre>
732 <h2><a id=
"refspec"></a>Revision Specification
</h2>
733 <div class=
"sectionbody">
734 <p>This section describes various ways to specify what revisions to display or
735 otherwise limit the view to. tig(
1) does not itself parse the described
736 revision options so refer to the relevant git man pages for futher
737 information. Relevant man pages besides git-log(
1) are git-diff(
1) and
739 <p>You can tune the interaction with git by making use of the options explained
740 in this section. For example, by configuring the environment variables
741 described in the
<a href=
"#history-commands">"History commands"</a> section.
</p>
742 <h3>Limit by Path Name
</h3>
743 <p>If you are interested only in those revisions that made changes to a specific
744 file (or even several files) list the files like this:
</p>
745 <div class=
"literalblock">
746 <div class=
"content">
747 <pre><tt>$ tig log Makefile README
</tt></pre>
749 <p>To avoid ambiguity with repository references such as tag name, be sure to
750 separate file names from other git options using
"--". So if you have a file
751 named
<em>master
</em> it will clash with the reference named
<em>master
</em>, and thus you
752 will have to use:
</p>
753 <div class=
"literalblock">
754 <div class=
"content">
755 <pre><tt>$ tig log -- master
</tt></pre>
757 <div class=
"admonitionblock">
760 <div class=
"title">Note
</div>
762 <td class=
"content">For the main view, avoiding ambiguity will in some cases require you to
763 specify two
"--" options. The first will make tig(
1) stop option processing
764 and the latter will be passed to git log.
</td>
767 <h3>Limit by Date or Number
</h3>
768 <p>To speed up interaction with git, you can limit the amount of commits to show
769 both for the log and main view. Either limit by date using e.g.
770 <tt>—since=
1.month
</tt> or limit by the number of commits using
<tt>-n400
</tt>.
</p>
771 <p>If you are only interested in changed that happened between two dates you can
773 <div class=
"literalblock">
774 <div class=
"content">
775 <pre><tt>$ tig --
--after=
"May 5th" --before=
"2006-05-16 15:44"</tt></pre>
777 <div class=
"admonitionblock">
780 <div class=
"title">Note
</div>
782 <td class=
"content">If you want to avoid having to quote dates containing spaces you can use
783 "." instead, e.g.
<tt>—after=May
.5th
</tt>.
</td>
786 <h3>Limiting by Commit Ranges
</h3>
787 <p>Alternatively, commits can be limited to a specific range, such as
"all
788 commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:
</p>
789 <div class=
"literalblock">
790 <div class=
"content">
791 <pre><tt>$ tig log tag-
1.0..tag-
2.0</tt></pre>
793 <p>This way of commit limiting makes it trivial to only browse the commits which
794 haven't been pushed to a remote branch. Assuming
<em>origin
</em> is your upstream
795 remote branch, using:
</p>
796 <div class=
"literalblock">
797 <div class=
"content">
798 <pre><tt>$ tig log origin..HEAD
</tt></pre>
800 <p>will list what will be pushed to the remote branch. Optionally, the ending
801 <em>HEAD
</em> can be left out since it is implied.
</p>
802 <h3>Limiting by Reachability
</h3>
803 <p>Git interprets the range specifier
"tag-1.0..tag-2.0" as
"all commits
804 reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>". Where reachability refers
805 to what commits are ancestors (or part of the history) of the branch or tagged
806 revision in question.
</p>
807 <p>If you prefer to specify which commit to preview in this way use the
809 <div class=
"literalblock">
810 <div class=
"content">
811 <pre><tt>$ tig log tag-
2.0 ^tag-
1.0</tt></pre>
813 <p>You can think of
<em>^
</em> as a negation operator. Using this alternate syntax, it
814 is possible to further prune commits by specifying multiple branch cut offs.
</p>
815 <h3>Combining Revisions Specification
</h3>
816 <p>Revisions options can to some degree be combined, which makes it possible to
817 say
"show at most 20 commits from within the last month that changed files
818 under the Documentation/ directory."</p>
819 <div class=
"literalblock">
820 <div class=
"content">
821 <pre><tt>$ tig -- --since=
1.month -n20 -- Documentation/
</tt></pre>
823 <h3>Examining All Repository References
</h3>
824 <p>In some cases, it can be useful to query changes across all references in a
825 repository. An example is to ask
"did any line of development in this
826 repository change a particular file within the last week". This can be
827 accomplished using:
</p>
828 <div class=
"literalblock">
829 <div class=
"content">
830 <pre><tt>$ tig -- --all --since=
1.week -- Makefile
</tt></pre>
834 <div class=
"sectionbody">
835 <p>Known bugs and problems:
</p>
839 In it's current state tig is pretty much UTF-
8 only.
844 If the screen width is very small the main view can draw
845 outside the current view causing bad wrapping. Same goes
846 for title and status windows.
851 The cursor can wrap-around on the last line and cause the
857 The prompt doesn't work while loading.
863 <div class=
"sectionbody">
864 <p>Copyright (c)
2006 Jonas Fonseca
<fonseca@diku.dk
></p>
865 <p>This program is free software; you can redistribute it and/or modify
866 it under the terms of the GNU General Public License as published by
867 the Free Software Foundation; either version
2 of the License, or
868 (at your option) any later version.
</p>
870 <h2>References and Related Tools
</h2>
871 <div class=
"sectionbody">
875 Homepage:
<a href=
"http://jonas.nitro.dk/tig">http://jonas.nitro.dk/tig
</a>
880 Releases:
<a href=
"http://jonas.nitro.dk/tig/releases">http://jonas.nitro.dk/tig/releases
</a>
885 Git URL:
<a href=
"http://jonas.nitro.dk/tig/tig.git">http://jonas.nitro.dk/tig/tig.git
</a>
890 Gitweb:
<a href=
"http://pasky.or.cz/gitweb.cgi?p=tig.git;a=summary">http://pasky.or.cz/gitweb.cgi?p=tig.git;a=summary
</a>
894 <p>Git porcelains:
</p>
898 <a href=
"http://www.kernel.org/pub/software/scm/git/docs/">git
</a>,
903 <a href=
"http://www.kernel.org/pub/software/scm/cogito/docs/">Cogito
</a>
907 <p>Other git repository browsers:
</p>
927 <div id=
"footer-text">
928 Last updated
06-Jun-
2006 13:
56:
34 CEST