1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
\r
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
\r
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
6 <meta name="generator" content="AsciiDoc 7.0.2" />
\r
7 <style type="text/css">
\r
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
\r
11 border: 1px solid red;
\r
16 margin: 1em 5% 1em 5%;
\r
20 a:visited { color: fuchsia; }
\r
34 h1, h2, h3, h4, h5, h6 {
\r
36 font-family: sans-serif;
\r
38 margin-bottom: 0.5em;
\r
43 border-bottom: 2px solid silver;
\r
46 border-bottom: 2px solid silver;
\r
56 border: 1px solid silver;
\r
61 margin-bottom: 0.5em;
\r
71 font-family: sans-serif;
\r
78 font-family: sans-serif;
\r
82 font-family: sans-serif;
\r
84 border-top: 2px solid silver;
\r
90 padding-bottom: 0.5em;
\r
94 padding-bottom: 0.5em;
\r
98 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
\r
99 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
\r
100 div.admonitionblock {
\r
103 margin-bottom: 1.5em;
\r
105 div.admonitionblock {
\r
107 margin-bottom: 2.5em;
\r
110 div.content { /* Block element content. */
\r
114 /* Block element titles. */
\r
115 div.title, caption.title {
\r
116 font-family: sans-serif;
\r
120 margin-bottom: 0.5em;
\r
126 td div.title:first-child {
\r
129 div.content div.title:first-child {
\r
132 div.content + div.title {
\r
136 div.sidebarblock > div.content {
\r
137 background: #ffffee;
\r
138 border: 1px solid silver;
\r
142 div.listingblock > div.content {
\r
143 border: 1px solid silver;
\r
144 background: #f4f4f4;
\r
148 div.quoteblock > div.content {
\r
149 padding-left: 2.0em;
\r
151 div.quoteblock .attribution {
\r
155 div.admonitionblock .icon {
\r
156 vertical-align: top;
\r
159 text-decoration: underline;
\r
161 padding-right: 0.5em;
\r
163 div.admonitionblock td.content {
\r
164 padding-left: 0.5em;
\r
165 border-left: 2px solid silver;
\r
168 div.exampleblock > div.content {
\r
169 border-left: 2px solid silver;
\r
173 div.verseblock div.content {
\r
177 div.imageblock div.content { padding-left: 0; }
\r
178 div.imageblock img { border: 1px solid silver; }
\r
179 span.image img { border-style: none; }
\r
183 margin-bottom: 0.8em;
\r
188 font-style: italic;
\r
190 dd > *:first-child {
\r
195 list-style-position: outside;
\r
198 list-style-type: lower-alpha;
\r
201 div.tableblock > table {
\r
202 border-color: #527bbd;
\r
206 font-family: sans-serif;
\r
215 margin-bottom: 0.8em;
\r
218 vertical-align: top;
\r
219 font-style: italic;
\r
220 padding-right: 0.8em;
\r
223 vertical-align: top;
\r
227 div#footer-badges { display: none; }
\r
229 include::./stylesheets/xhtml11-manpage.css[]
\r
230 /* Workarounds for IE6's broken and incomplete CSS2. */
\r
232 div.sidebar-content {
\r
233 background: #ffffee;
\r
234 border: 1px solid silver;
\r
237 div.sidebar-title, div.image-title {
\r
238 font-family: sans-serif;
\r
241 margin-bottom: 0.5em;
\r
244 div.listingblock div.content {
\r
245 border: 1px solid silver;
\r
246 background: #f4f4f4;
\r
250 div.quoteblock-content {
\r
251 padding-left: 2.0em;
\r
254 div.exampleblock-content {
\r
255 border-left: 2px solid silver;
\r
256 padding-left: 0.5em;
\r
259 <title>TIG(1)</title>
\r
267 <div class="sectionbody">
\r
269 text-mode interface for git
\r
274 <div class="sectionbody">
\r
275 <div class="verseblock">
\r
276 <div class="content">tig [options]
\r
277 tig [options] [--] [git log options]
\r
278 tig [options] log [git log options]
\r
279 tig [options] diff [git diff options]
\r
280 tig [options] show [git show options]
\r
281 tig [options] < [git command output]</div></div>
\r
283 <h2>DESCRIPTION</h2>
\r
284 <div class="sectionbody">
\r
285 <p>Browse changes in a git repository. Additionally, tig(1) can also act
\r
286 as a pager for output of various git commands.</p>
\r
287 <p>When browsing repositories, tig(1) uses the underlying git commands
\r
288 to present the user with various views, such as summarized commit log
\r
289 and showing the commit with the log message, diffstat, and the diff.</p>
\r
290 <p>Using tig(1) as a pager, it will display input from stdin and try
\r
291 to colorize it.</p>
\r
294 <div class="sectionbody">
\r
301 Start up in log view using the internal log command.
\r
309 Start up in diff view using the internal diff command.
\r
313 -n[INTERVAL], --line-number[=INTERVAL]
\r
317 Prefix line numbers in log and diff view.
\r
318 Optionally, with interval different than each line.
\r
322 -t[NSPACES], --tab-size[=NSPACES]
\r
326 Set the number of spaces tabs should be expanded to.
\r
334 Show version and exit.
\r
342 Show help message and exit.
\r
350 End of tig(1) options. Useful when specifying command
\r
351 options for the main view. Example:
\r
353 <div class="literalblock">
\r
354 <div class="content">
\r
355 <pre><tt>$ tig -- --since=1.month</tt></pre>
\r
359 log [git log options]
\r
363 Open log view using the given git log options.
\r
367 diff [git diff options]
\r
371 Open diff view using the given git diff options.
\r
375 show [git show options]
\r
379 Open diff view using the given git show options.
\r
387 tig(1) will stop the option parsing when the first
\r
388 command line parameter not starting with "-" is
\r
389 encountered. All options including this one will be
\r
390 passed to git log when loading the main view.
\r
391 This makes it possible to say:
\r
393 <div class="literalblock">
\r
394 <div class="content">
\r
395 <pre><tt>$ tig tag-1.0..HEAD</tt></pre>
\r
399 <h3>Pager mode</h3>
\r
400 <p>If stdin is a pipe, any log or diff options will be ignored and the
\r
401 pager view will be opened loading data from stdin. The pager mode
\r
402 can be used for colorizing output from various git commands.</p>
\r
403 <p>Example on how to colorize the output of git-show(1):</p>
\r
404 <div class="literalblock">
\r
405 <div class="content">
\r
406 <pre><tt>$ git show | tig</tt></pre>
\r
408 <h3>Git command options</h3>
\r
409 <p>All git command options specified on the command line will
\r
410 be passed to the given command and all will be shell quoted
\r
411 before they are passed to the shell.</p>
\r
412 <div class="admonitionblock">
\r
415 <div class="title">Note</div>
\r
417 <td class="content">If you specify options for the main view, you should
\r
418 not use the <tt>--pretty</tt> option as this option will be set
\r
419 automatically to the format expected by the main view.</td>
\r
422 <p>Example on how to open the log view and show both author and
\r
423 committer information:</p>
\r
424 <div class="literalblock">
\r
425 <div class="content">
\r
426 <pre><tt>$ tig log --pretty=fuller</tt></pre>
\r
428 <p>See the <a href="#refspec">"Specifying revisions"</a> section below
\r
429 for an introduction to revision options supported by the git
\r
430 commands. For details on specific git command options, refer
\r
431 to the man page of the command in question.</p>
\r
433 <h2>ENVIRONMENT VARIABLES</h2>
\r
434 <div class="sectionbody">
\r
435 <p>Several options related to the interface with git can be configured
\r
436 via environment options.</p>
\r
437 <h3>Repository references</h3>
\r
438 <p>Commits that are referenced by tags and branch heads will be marked
\r
439 by the reference name surrounded by <em>[</em> and <em>]</em>:</p>
\r
440 <div class="literalblock">
\r
441 <div class="content">
\r
442 <pre><tt>2006-03-26 19:42 Petr Baudis | [cogito-0.17.1] Cogito 0.17.1</tt></pre>
\r
444 <p>If you want to filter out certain directories under <tt>.git/refs/</tt>, say
\r
445 <tt>tmp</tt> you can do it by setting the following variable:</p>
\r
446 <div class="literalblock">
\r
447 <div class="content">
\r
448 <pre><tt>$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig</tt></pre>
\r
450 <p>Or set the variable permanently in your environment.</p>
\r
457 Set command for retrieving all repository references. The command
\r
458 should output data in the same format as git-ls-remote(1).
\r
462 <h3><a id="view-commands"></a>View commands</h3>
\r
463 <p>It is possible to alter which commands are used for the different views.
\r
464 If for example you prefer commits in the main view to be sorted by date
\r
465 and only show 500 commits, use:</p>
\r
466 <div class="literalblock">
\r
467 <div class="content">
\r
468 <pre><tt>$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig</tt></pre>
\r
470 <p>Or set the variable permanently in your environment.</p>
\r
471 <p>Notice, how <tt>%s</tt> is used to specify the commit reference. There can
\r
472 be a maximum of 5 <tt>%s</tt> ref specifications.</p>
\r
479 The command used for the diff view. By default, git show is used
\r
488 The command used for the log view. If you prefer to have both
\r
489 author and committer shown in the log view be sure to pass
\r
490 <tt>--pretty=fuller</tt> to git log.
\r
498 The command used for the main view. Note, you must always specify
\r
499 the option: <tt>--pretty=raw</tt> since the main view parser expects to
\r
505 <h2>The viewer</h2>
\r
506 <div class="sectionbody">
\r
507 <p>The display consists of a status window on the last line of the screen and
\r
508 one or more views. The default is to only show one view at the time but it
\r
509 is possible to split both the main and log view to also show the commit
\r
511 <p>If you are in the log view and press <em>Enter</em> when the current line is a
\r
512 commit line, such as:</p>
\r
513 <div class="literalblock">
\r
514 <div class="content">
\r
515 <pre><tt>commit 4d55caff4cc89335192f3e566004b4ceef572521</tt></pre>
\r
517 <p>You will split the view so that the log view is displayed in the top window
\r
518 and the diff view in the bottom window. You can switch between the two
\r
519 views by pressing <em>Tab</em>. To maximize the log view again, simply press <em>l</em>.</p>
\r
520 <h3>Current head and commit ID</h3>
\r
521 <p>The viewer keeps track of both what head and commit ID you are currently
\r
522 viewing. The commit ID will follow the cursor line and change everytime time
\r
523 you highlight a different commit. Whenever you reopen the diff view it
\r
524 will be reloaded, if the commit ID changed.</p>
\r
525 <p>The head ID is used when opening the main and log view to indicate from
\r
526 what revision to show history.</p>
\r
528 <p>tig(1) presents various <em>views</em> of a repository. Each view is based on output
\r
529 from an external command, most often <em>git log</em>, <em>git diff</em>, or <em>git show</em>.</p>
\r
536 Is the default view, and it shows a one line summary of each commit
\r
537 in the chosen list of revisions. The summary includes commit date,
\r
538 author, and the first line of the log message. Additionally, any
\r
539 repository references, such as tags, will be shown.
\r
547 Presents a more rich view of the revision log showing the whole log
\r
548 message and the diffstat.
\r
556 Shows either the diff of the current working tree, that is, what
\r
557 has changed since the last commit, or the commit diff complete
\r
558 with log message, diffstat and diff.
\r
566 Is used for displaying both input from stdin and output from git
\r
567 commands entered in the internal prompt.
\r
575 Displays the information from the tig(1) man page. For the help view
\r
576 to work you need to have the tig(1) man page installed.
\r
580 <h3>Title windows</h3>
\r
581 <p>Each view has a title window which shows the name of the view, current
\r
582 commit ID if available, and where the view is positioned:</p>
\r
583 <div class="literalblock">
\r
584 <div class="content">
\r
585 <pre><tt>[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)</tt></pre>
\r
587 <p>By default, the title of the current view is highlighted using bold font.</p>
\r
590 <div class="sectionbody">
\r
591 <p>Below the default key bindings are shown.</p>
\r
592 <h3>View switching</h3>
\r
599 Switch to main view.
\r
607 Switch to diff view.
\r
615 Switch to log view.
\r
623 Switch to pager view.
\r
635 <h3>View manipulation</h3>
\r
642 Close view, if multiple views are open it will jump back to the
\r
643 previous view in the view stack. If it is the last open view it
\r
644 will quit. Use <em>Q</em> to quit all views at once.
\r
652 This key is "context sensitive" depending on what view you are
\r
653 currently in. When in log view on a commit line or in the main
\r
654 view, split the view and show the commit diff. In the diff view
\r
655 pressing Enter will simply scroll the view one line down.
\r
663 Switch to next view.
\r
671 This key is "context sensitive" and will move the cursor one
\r
672 line up. However, uf you opened a diff view from the main view
\r
673 (split- or full-screen) it will change the cursor to point to
\r
674 the previous commit in the main view and update the diff view
\r
683 Similar to <em>Up</em> but will move down.
\r
687 <h3>Cursor navigation</h3>
\r
694 Move cursor one line up.
\r
702 Move cursor one line down.
\r
716 Move cursor one page up.
\r
727 Move cursor one page down.
\r
735 Jump to first line.
\r
754 Scroll view one line up.
\r
762 Scroll view one line down.
\r
770 Scroll view one page up.
\r
778 Scroll view one page down.
\r
805 Stop all background loading. This can be useful if you use
\r
806 tig(1) in a repository with a long history without limiting
\r
823 Toggle line numbers on/off.
\r
831 Open prompt. This allows you to specify what git command
\r
834 <div class="literalblock">
\r
835 <div class="content">
\r
836 <pre><tt>:log -p</tt></pre>
\r
841 <h2><a id="refspec"></a>Revision specification</h2>
\r
842 <div class="sectionbody">
\r
843 <p>This section describes various ways to specify what revisions to display
\r
844 or otherwise limit the view to. tig(1) does not itself parse the described
\r
845 revision options so refer to the relevant git man pages for futher
\r
846 information. Relevant man pages besides git-log(1) are git-diff(1) and
\r
847 git-rev-list(1).</p>
\r
848 <p>You can tune the interaction with git by making use of the options
\r
849 explained in this section. For example, by configuring the environment
\r
850 variables described in the <a href="#view-commands">"View commands"</a> section.</p>
\r
851 <h3>Limit by path name</h3>
\r
852 <p>If you are interested only in those revisions that made changes to a
\r
853 specific file (or even several files) list the files like this:</p>
\r
854 <div class="literalblock">
\r
855 <div class="content">
\r
856 <pre><tt>$ tig log Makefile README</tt></pre>
\r
858 <p>To avoid ambiguity with repository references such as tag name, be sure
\r
859 to separate file names from other git options using "--". So if you
\r
860 have a file named <em>master</em> it will clash with the reference named
\r
861 <em>master</em>, and thus you will have to use:</p>
\r
862 <div class="literalblock">
\r
863 <div class="content">
\r
864 <pre><tt>$ tig log -- master</tt></pre>
\r
866 <div class="admonitionblock">
\r
869 <div class="title">Note</div>
\r
871 <td class="content">For the main view, avoiding ambiguity will in some cases require
\r
872 you to specify two "--" options. The first will make tig(1) stop
\r
873 option processing and the latter will be passed to git log.</td>
\r
876 <h3>Limit by date or number</h3>
\r
877 <p>To speed up interaction with git, you can limit the amount of commits
\r
878 to show both for the log and main view. Either limit by date using
\r
879 e.g. <tt>--since=1.month</tt> or limit by the number of commits using <tt>-n400</tt>.</p>
\r
880 <p>If you are only interested in changed that happened between two dates
\r
882 <div class="literalblock">
\r
883 <div class="content">
\r
884 <pre><tt>$ tig -- --after="May 5th" --before="2006-05-16 15:44"</tt></pre>
\r
886 <div class="admonitionblock">
\r
889 <div class="title">Note</div>
\r
891 <td class="content">If you want to avoid having to quote dates containing spaces you
\r
892 can use "." instead, e.g. <tt>--after=May.5th</tt>.</td>
\r
895 <h3>Limiting by commit ranges</h3>
\r
896 <p>Alternatively, commits can be limited to a specific range, such as
\r
897 "all commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:</p>
\r
898 <div class="literalblock">
\r
899 <div class="content">
\r
900 <pre><tt>$ tig log tag-1.0..tag-2.0</tt></pre>
\r
902 <p>This way of commit limiting makes it trivial to only browse the commits
\r
903 which haven't been pushed to a remote branch. Assuming <em>origin</em> is your
\r
904 upstream remote branch, using:</p>
\r
905 <div class="literalblock">
\r
906 <div class="content">
\r
907 <pre><tt>$ tig log origin..HEAD</tt></pre>
\r
909 <p>will list what will be pushed to the remote branch. Optionally, the ending
\r
910 <em>HEAD</em> can be left out since it is implied.</p>
\r
911 <h3>Limiting by reachability</h3>
\r
912 <p>Git interprets the range specifier "tag-1.0..tag-2.0" as
\r
913 "all commits reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>".
\r
914 Where reachability refers to what commits are ancestors (or part of the
\r
915 history) of the branch or tagged revision in question.</p>
\r
916 <p>If you prefer to specify which commit to preview in this way use the
\r
918 <div class="literalblock">
\r
919 <div class="content">
\r
920 <pre><tt>$ tig log tag-2.0 ^tag-1.0</tt></pre>
\r
922 <p>You can think of <em>^</em> as a negation operator. Using this alternate syntax,
\r
923 it is possible to further prune commits by specifying multiple branch
\r
925 <h3>Combining revisions specification</h3>
\r
926 <p>Revisions options can to some degree be combined, which makes it possible
\r
927 to say "show at most 20 commits from within the last month that changed
\r
928 files under the Documentation/ directory."</p>
\r
929 <div class="literalblock">
\r
930 <div class="content">
\r
931 <pre><tt>$ tig -- --since=1.month -n20 -- Documentation/</tt></pre>
\r
933 <h3>Examining all repository references</h3>
\r
934 <p>In some cases, it can be useful to query changes across all references
\r
935 in a repository. An example is to ask "did any line of development in
\r
936 this repository change a particular file within the last week". This
\r
937 can be accomplished using:</p>
\r
938 <div class="literalblock">
\r
939 <div class="content">
\r
940 <pre><tt>$ tig -- --all --since=1.week -- Makefile</tt></pre>
\r
944 <div class="sectionbody">
\r
945 <p>Known bugs and problems:</p>
\r
949 In it's current state tig is pretty much UTF-8 only.
\r
954 If the screen width is very small the main view can draw
\r
955 outside the current view causing bad wrapping. Same goes
\r
956 for title and status windows.
\r
962 <div class="sectionbody">
\r
963 <p>Features that should be explored.</p>
\r
978 <div class="sectionbody">
\r
979 <p>Copyright (c) Jonas Fonseca <fonseca@diku.dk>, 2006</p>
\r
980 <p>This program is free software; you can redistribute it and/or modify
\r
981 it under the terms of the GNU General Public License as published by
\r
982 the Free Software Foundation; either version 2 of the License, or
\r
983 (at your option) any later version.</p>
\r
986 <div class="sectionbody">
\r
987 <div class="verseblock">
\r
988 <div class="content"><a href="http://www.kernel.org/pub/software/scm/git/docs/">git(7)</a>,
\r
989 <a href="http://www.kernel.org/pub/software/scm/cogito/docs/">cogito(7)</a>
\r
990 gitk(1): git repository browser written using tcl/tk,
\r
991 qgit(1): git repository browser written using c++/Qt,
\r
992 gitview(1): git repository browser written using python/gtk.</div></div>
\r
995 <div id="footer-text">
\r
996 Last updated 21-May-2006 05:05:28 CEST
\r