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 End of tig(1) options. Useful when specifying command
\r
343 options for the main view. Example:
\r
345 <div class="literalblock">
\r
346 <div class="content">
\r
347 <pre><tt>$ tig -- --since=1.month</tt></pre>
\r
351 log [git log options]
\r
355 Open log view using the given git log options.
\r
359 diff [git diff options]
\r
363 Open diff view using the given git diff options.
\r
367 show [git show options]
\r
371 Open diff view using the given git show options.
\r
379 tig(1) will stop the option parsing when the first
\r
380 command line parameter not starting with "-" is
\r
381 encountered. All options including this one will be
\r
382 passed to git log when loading the main view.
\r
383 This makes it possible to say:
\r
385 <div class="literalblock">
\r
386 <div class="content">
\r
387 <pre><tt>$ tig tag-1.0..HEAD</tt></pre>
\r
391 <h3>Pager mode</h3>
\r
392 <p>If stdin is a pipe, any log or diff options will be ignored and the
\r
393 pager view will be opened loading data from stdin. The pager mode
\r
394 can be used for colorizing output from various git commands.</p>
\r
395 <p>Example on how to colorize the output of git-show(1):</p>
\r
396 <div class="literalblock">
\r
397 <div class="content">
\r
398 <pre><tt>$ git show | tig</tt></pre>
\r
400 <h3>Git command options</h3>
\r
401 <p>All git command options specified on the command line will
\r
402 be passed to the given command and all will be shell quoted
\r
403 before they are passed to the shell.</p>
\r
404 <div class="admonitionblock">
\r
407 <div class="title">Note</div>
\r
409 <td class="content">If you specify options for the main view, you should
\r
410 not use the <tt>--pretty</tt> option as this option will be set
\r
411 automatically to the format expected by the main view.</td>
\r
414 <p>Example on how to open the log view and show both author and
\r
415 committer information:</p>
\r
416 <div class="literalblock">
\r
417 <div class="content">
\r
418 <pre><tt>$ tig log --pretty=fuller</tt></pre>
\r
420 <p>See the <a href="#refspec">"Specifying revisions"</a> section below
\r
421 for an introduction to revision options supported by the git
\r
422 commands. For details on specific git command options, refer
\r
423 to the man page of the command in question.</p>
\r
425 <h2>ENVIRONMENT VARIABLES</h2>
\r
426 <div class="sectionbody">
\r
427 <p>Several options related to the interface with git can be configured
\r
428 via environment options.</p>
\r
429 <h3>Repository references</h3>
\r
430 <p>Commits that are referenced by tags and branch heads will be marked
\r
431 by the reference name surrounded by <em>[</em> and <em>]</em>:</p>
\r
432 <div class="literalblock">
\r
433 <div class="content">
\r
434 <pre><tt>2006-03-26 19:42 Petr Baudis | [cogito-0.17.1] Cogito 0.17.1</tt></pre>
\r
436 <p>If you want to filter out certain directories under <tt>.git/refs/</tt>, say
\r
437 <tt>tmp</tt> you can do it by setting the following variable:</p>
\r
438 <div class="literalblock">
\r
439 <div class="content">
\r
440 <pre><tt>$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig</tt></pre>
\r
442 <p>Or set the variable permanently in your environment.</p>
\r
449 Set command for retrieving all repository references. The command
\r
450 should output data in the same format as git-ls-remote(1).
\r
454 <h3><a id="view-commands"></a>View commands</h3>
\r
455 <p>It is possible to alter which commands are used for the different views.
\r
456 If for example you prefer commits in the main view to be sorted by date
\r
457 and only show 500 commits, use:</p>
\r
458 <div class="literalblock">
\r
459 <div class="content">
\r
460 <pre><tt>$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig</tt></pre>
\r
462 <p>Or set the variable permanently in your environment.</p>
\r
463 <p>Notice, how <tt>%s</tt> is used to specify the commit reference. There can
\r
464 be a maximum of 5 <tt>%s</tt> ref specifications.</p>
\r
471 The command used for the diff view. By default, git show is used
\r
480 The command used for the log view. If you prefer to have both
\r
481 author and committer shown in the log view be sure to pass
\r
482 <tt>--pretty=fuller</tt> to git log.
\r
490 The command used for the main view. Note, you must always specify
\r
491 the option: <tt>--pretty=raw</tt> since the main view parser expects to
\r
497 <h2>The viewer</h2>
\r
498 <div class="sectionbody">
\r
499 <p>tig(1) presents various <em>views</em> of a repository. Each view is based on output
\r
500 from an external command, most often <em>git log</em>, <em>git diff</em>, or <em>git show</em>.</p>
\r
507 Is the default view, and it shows a one line summary of each commit
\r
508 in the chosen list of revisions. The summary includes commit date,
\r
509 author, and the first line of the log message. Additionally, any
\r
510 repository references, such as tags, will be shown.
\r
518 Presents a more rich view of the revision log showing the whole log
\r
519 message and the diffstat.
\r
527 Shows either the diff of the current working tree, that is, what
\r
528 has changed since the last commit, or the commit diff complete
\r
529 with log message, diffstat and diff.
\r
537 Is used for displaying both input from stdin and output from git
\r
538 commands entered in the internal prompt.
\r
546 Displays the information from the tig(1) man page. For the help view
\r
547 to work you need to have the tig(1) man page installed.
\r
553 <div class="sectionbody">
\r
554 <p>Below the default key bindings are shown.</p>
\r
555 <h3>View switching</h3>
\r
562 Switch to main view.
\r
570 Switch to diff view.
\r
578 Switch to log view.
\r
586 Switch to pager view.
\r
602 If on a commit line show the commit diff. Additionally, if in
\r
603 main or log view this will split the view. To open the commit
\r
604 diff in full size view either use <em>d</em> or press Return twice.
\r
612 Switch to next view.
\r
616 <h3>Cursor navigation</h3>
\r
623 Move cursor one line up.
\r
631 Move cursor one line down.
\r
639 Move cursor one line up and enter. When used in the main view
\r
640 this will always show the diff of the current commit in the
\r
649 Move cursor one line down and enter.
\r
657 Move cursor one page up.
\r
665 Move cursor one page down.
\r
673 Jump to first line.
\r
692 Scroll view one line up.
\r
700 Scroll view one line down.
\r
708 Scroll view one page up.
\r
716 Scroll view one page down.
\r
743 Stop all background loading. This can be useful if you use
\r
744 tig(1) in a repository with a long history without limiting
\r
761 Toggle line numbers on/off.
\r
769 Open prompt. This allows you to specify what git command
\r
772 <div class="literalblock">
\r
773 <div class="content">
\r
774 <pre><tt>:log -p</tt></pre>
\r
779 <h2><a id="refspec"></a>Revision specification</h2>
\r
780 <div class="sectionbody">
\r
781 <p>This section describes various ways to specify what revisions to display
\r
782 or otherwise limit the view to. tig(1) does not itself parse the described
\r
783 revision options so refer to the relevant git man pages for futher
\r
784 information. Relevant man pages besides git-log(1) are git-diff(1) and
\r
785 git-rev-list(1).</p>
\r
786 <p>You can tune the interaction with git by making use of the options
\r
787 explained in this section. For example, by configuring the environment
\r
788 variables described in the <a href="#view-commands">"View commands"</a> section.</p>
\r
789 <h3>Limit by path name</h3>
\r
790 <p>If you are interested only in those revisions that made changes to a
\r
791 specific file (or even several files) list the files like this:</p>
\r
792 <div class="literalblock">
\r
793 <div class="content">
\r
794 <pre><tt>$ tig log Makefile</tt></pre>
\r
796 <p>To avoid ambiguity with repository references such as tag name, be sure
\r
797 to separate file names from other git options using "--". So if you
\r
798 have a file named <em>master</em> it will clash with the reference named
\r
799 <em>master</em>, and thus you will have to use:</p>
\r
800 <div class="literalblock">
\r
801 <div class="content">
\r
802 <pre><tt>$ tig log -- master</tt></pre>
\r
804 <div class="admonitionblock">
\r
807 <div class="title">Note</div>
\r
809 <td class="content">For the main view, avoiding ambiguity will in some cases require
\r
810 you to specify two "--" options. The first will make tig(1) stop
\r
811 option processing and the latter will be passed to git log.</td>
\r
814 <h3>Limit by date or number</h3>
\r
815 <p>To speed up interaction with git, you can limit the amount of commits
\r
816 to show both for the log and main view. Either limit by date using
\r
817 e.g. <tt>--since=1.month</tt> or limit by the number of commits using <tt>-n400</tt>.</p>
\r
818 <p>If you are only interested in changed that happened between two dates
\r
820 <div class="literalblock">
\r
821 <div class="content">
\r
822 <pre><tt>$ tig -- --after=May.5th --before=2006-05-16.15:44</tt></pre>
\r
824 <div class="admonitionblock">
\r
827 <div class="title">Note</div>
\r
829 <td class="content">The dot (".") is used as a separator instead of a space to avoid
\r
830 having to quote the option value. If you prefer use <tt>--after="May 5th"</tt>
\r
831 instead of <tt>--after="May 5th"</tt>.</td>
\r
834 <h3>Limiting by commit ranges</h3>
\r
835 <p>Alternatively, commits can be limited to a specific range, such as
\r
836 "all commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:</p>
\r
837 <div class="literalblock">
\r
838 <div class="content">
\r
839 <pre><tt>$ tig log tag-1.0..tag-2.0</tt></pre>
\r
841 <p>This way of commit limiting makes it trivial to only browse the commits
\r
842 which haven't been pushed to a remote branch. Assuming <em>origin</em> is your
\r
843 upstream remote branch, using:</p>
\r
844 <div class="literalblock">
\r
845 <div class="content">
\r
846 <pre><tt>$ tig log origin..HEAD</tt></pre>
\r
848 <p>will list what will be pushed to the remote branch. Optionally, the ending
\r
849 <em>HEAD</em> can be left out since it is implied.</p>
\r
850 <h3>Limiting by reachability</h3>
\r
851 <p>Git interprets the range specifier "tag-1.0..tag-2.0" as
\r
852 "all commits reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>".
\r
853 Where reachability refers to what commits are ancestors (or part of the
\r
854 history) of the branch or tagged revision in question.</p>
\r
855 <p>If you prefer to specify which commit to preview in this way use the
\r
857 <div class="literalblock">
\r
858 <div class="content">
\r
859 <pre><tt>$ tig log tag-2.0 ^tag-1.0</tt></pre>
\r
861 <p>You can think of <em>^</em> as a negation operator. Using this alternate syntax,
\r
862 it is possible to further prune commits by specifying multiple branch
\r
864 <h3>Combining revisions specification</h3>
\r
865 <p>Revisions options can to some degree be combined, which makes it possible
\r
866 to say "show at most 20 commits from within the last month that changed
\r
867 files under the Documentation/ directory."</p>
\r
868 <div class="literalblock">
\r
869 <div class="content">
\r
870 <pre><tt>$ tig -- --since=1.month -n20 -- Documentation/</tt></pre>
\r
872 <h3>Examining all repository references</h3>
\r
873 <p>In some cases, it can be useful to query changes across all references
\r
874 in a repository. An example is to ask "did any line of development in
\r
875 this repository change a particular file within the last week". This
\r
876 can be accomplished using:</p>
\r
877 <div class="literalblock">
\r
878 <div class="content">
\r
879 <pre><tt>$ tig -- --all --since=1.week -- Makefile</tt></pre>
\r
883 <div class="sectionbody">
\r
884 <p>Known bugs and problems:</p>
\r
888 If the screen width is very small the main view can draw
\r
889 outside the current view causing bad wrapping. Same goes
\r
890 for title and status windows.
\r
896 <div class="sectionbody">
\r
897 <p>Features that should be explored.</p>
\r
912 <div class="sectionbody">
\r
913 <p>Copyright (c) Jonas Fonseca <fonseca@diku.dk>, 2006</p>
\r
914 <p>This program is free software; you can redistribute it and/or modify
\r
915 it under the terms of the GNU General Public License as published by
\r
916 the Free Software Foundation; either version 2 of the License, or
\r
917 (at your option) any later version.</p>
\r
920 <div class="sectionbody">
\r
921 <div class="verseblock">
\r
922 <div class="content"><a href="http://www.kernel.org/pub/software/scm/git/docs/">git(7)</a>,
\r
923 <a href="http://www.kernel.org/pub/software/scm/cogito/docs/">cogito(7)</a>
\r
924 gitk(1): git repository browser written using tcl/tk,
\r
925 qgit(1): git repository browser written using c++/Qt,
\r
926 gitview(1): git repository browser written using python/gtk.</div></div>
\r
929 <div id="footer-text">
\r
930 Last updated 17-May-2006 18:10:38 CEST
\r