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 /* Workarounds for IE6's broken and incomplete CSS2. */
\r
231 div.sidebar-content {
\r
232 background: #ffffee;
\r
233 border: 1px solid silver;
\r
236 div.sidebar-title, div.image-title {
\r
237 font-family: sans-serif;
\r
240 margin-bottom: 0.5em;
\r
243 div.listingblock div.content {
\r
244 border: 1px solid silver;
\r
245 background: #f4f4f4;
\r
249 div.quoteblock-content {
\r
250 padding-left: 2.0em;
\r
253 div.exampleblock-content {
\r
254 border-left: 2px solid silver;
\r
255 padding-left: 0.5em;
\r
258 <title>The tig Manual</title>
\r
262 <h1>The tig Manual</h1>
\r
263 <span id="author">Jonas Fonseca</span><br />
\r
264 <span id="email"><tt><<a href="mailto:fonseca@diku.dk">fonseca@diku.dk</a>></tt></span><br />
\r
266 <div id="preamble">
\r
267 <div class="sectionbody">
\r
268 <p>This is the manual for tig, the ncurses-based text-mode interface for git.
\r
269 Tig allows you to browse changes in a git repository and can additionally act
\r
270 as a pager for output of various git commands. When used as a pager, it will
\r
271 display input from stdin and colorize it.</p>
\r
272 <p>When browsing repositories, tig uses the underlying git commands to present
\r
273 the user with various views, such as summarized commit log and showing the
\r
274 commit with the log message, diffstat, and the diff.</p>
\r
275 <p><strong>Table of Contents</strong></p>
\r
279 <a href="#calling-conventions">Calling Conventions</a>
\r
284 <a href="#pager-mode">Pager Mode</a>
\r
289 <a href="#cmd-options">Git Command Options</a>
\r
296 <a href="#env-variables">Environment Variables</a>
\r
301 <a href="#repo-refs">Repository References</a>
\r
306 <a href="#history-commands">History Commands</a>
\r
313 <a href="#viewer">The Viewer</a>
\r
318 <a href="#commit-id">Current Head and Commit ID</a>
\r
323 <a href="#views">Views</a>
\r
328 <a href="#title-window">Title Windows</a>
\r
335 <a href="#keys">Default Keybindings</a>
\r
340 <a href="#view-switching">View Switching</a>
\r
345 <a href="#view-manipulation">View Manipulation</a>
\r
350 <a href="#cursor-nav">Cursor Navigation</a>
\r
355 <a href="#view-scrolling">Scrolling</a>
\r
360 <a href="#searching">Searching</a>
\r
367 <a href="#refspec">Revision Specification</a>
\r
372 <a href="#path-limiting">Limit by Path Name</a>
\r
377 <a href="#date-number-limiting">Limit by Date or Number</a>
\r
382 <a href="#commit-range-limiting">Limiting by Commit Ranges</a>
\r
387 <a href="#reachability-limiting">Limiting by Reachability</a>
\r
392 <a href="#refspec-combi">Combining Revisions Specification</a>
\r
397 <a href="#refspec-all">Examining All Repository References</a>
\r
404 <a href="#copy-right">Copyright</a>
\r
409 <a href="#references">References and Related Tools</a>
\r
415 <h2><a id="calling-conventions"></a>1. Calling Conventions</h2>
\r
416 <div class="sectionbody">
\r
417 <h3><a id="pager-mode"></a>1.1. Pager Mode</h3>
\r
418 <p>If stdin is a pipe, any log or diff options will be ignored and the pager view
\r
419 will be opened loading data from stdin. The pager mode can be used for
\r
420 colorizing output from various git commands.</p>
\r
421 <p>Example on how to colorize the output of git-show(1):</p>
\r
422 <div class="listingblock">
\r
423 <div class="content">
\r
424 <pre><tt>$ git show | tig</tt></pre>
\r
426 <h3><a id="cmd-options"></a>1.2. Git Command Options</h3>
\r
427 <p>All git command options specified on the command line will be passed to the
\r
428 given command and all will be shell quoted before they are passed to the
\r
430 <div class="admonitionblock">
\r
433 <div class="title">Note</div>
\r
435 <td class="content">If you specify options for the main view, you should not use the
\r
436 <tt>—pretty</tt> option as this option will be set automatically to the format
\r
437 expected by the main view.</td>
\r
440 <p>Example on how to open the log view and show both author and committer
\r
442 <div class="listingblock">
\r
443 <div class="content">
\r
444 <pre><tt>$ tig log --pretty=fuller</tt></pre>
\r
446 <p>See the <a href="#refspec">"Specifying revisions"</a> section below for an introduction
\r
447 to revision options supported by the git commands. For details on specific git
\r
448 command options, refer to the man page of the command in question.</p>
\r
450 <h2><a id="env-variables"></a>2. Environment Variables</h2>
\r
451 <div class="sectionbody">
\r
452 <p>Several options related to the interface with git can be configured via
\r
453 environment options.</p>
\r
454 <h3><a id="repo-refs"></a>2.1. Repository References</h3>
\r
455 <p>Commits that are referenced by tags and branch heads will be marked by the
\r
456 reference name surrounded by <em>[</em> and <em>]</em>:</p>
\r
457 <div class="listingblock">
\r
458 <div class="content">
\r
459 <pre><tt>2006-03-26 19:42 Petr Baudis | [cogito-0.17.1] Cogito 0.17.1</tt></pre>
\r
461 <p>If you want to filter out certain directories under <tt>.git/refs/</tt>, say <tt>tmp</tt>
\r
462 you can do it by setting the following variable:</p>
\r
463 <div class="listingblock">
\r
464 <div class="content">
\r
465 <pre><tt>$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig</tt></pre>
\r
467 <p>Or set the variable permanently in your environment.</p>
\r
474 Set command for retrieving all repository references. The command
\r
475 should output data in the same format as git-ls-remote(1).
\r
479 <h3><a id="history-commands"></a>2.2. History Commands</h3>
\r
480 <p>It is possible to alter which commands are used for the different views. If
\r
481 for example you prefer commits in the main view to be sorted by date and only
\r
482 show 500 commits, use:</p>
\r
483 <div class="listingblock">
\r
484 <div class="content">
\r
485 <pre><tt>$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig</tt></pre>
\r
487 <p>Or set the variable permanently in your environment.</p>
\r
488 <p>Notice, how <tt>%s</tt> is used to specify the commit reference. There can be a
\r
489 maximum of 5 <tt>%s</tt> ref specifications.</p>
\r
496 The command used for the diff view. By default, git show is used
\r
505 The command used for the log view. If you prefer to have both
\r
506 author and committer shown in the log view be sure to pass
\r
507 <tt>—pretty=fuller</tt> to git log.
\r
515 The command used for the main view. Note, you must always specify
\r
516 the option: <tt>—pretty=raw</tt> since the main view parser expects to
\r
522 <h2><a id="viewer"></a>3. The Viewer</h2>
\r
523 <div class="sectionbody">
\r
524 <p>The display consists of a status window on the last line of the screen and one
\r
525 or more views. The default is to only show one view at the time but it is
\r
526 possible to split both the main and log view to also show the commit diff.</p>
\r
527 <p>If you are in the log view and press <em>Enter</em> when the current line is a commit
\r
529 <div class="listingblock">
\r
530 <div class="content">
\r
531 <pre><tt>commit 4d55caff4cc89335192f3e566004b4ceef572521</tt></pre>
\r
533 <p>You will split the view so that the log view is displayed in the top window
\r
534 and the diff view in the bottom window. You can switch between the two views
\r
535 by pressing <em>Tab</em>. To maximize the log view again, simply press <em>l</em>.</p>
\r
536 <h3><a id="commit-id"></a>3.1. Current Head and Commit ID</h3>
\r
537 <p>The viewer keeps track of both what head and commit ID you are currently
\r
538 viewing. The commit ID will follow the cursor line and change every time
\r
539 you highlight a different commit. Whenever you reopen the diff view it will be
\r
540 reloaded, if the commit ID changed.</p>
\r
541 <p>The head ID is used when opening the main and log view to indicate from what
\r
542 revision to show history.</p>
\r
543 <h3><a id="views"></a>3.2. Views</h3>
\r
544 <p>Various <em>views</em> of a repository is presented. Each view is based on output
\r
545 from an external command, most often <em>git log</em>, <em>git diff</em>, or <em>git show</em>.</p>
\r
552 Is the default view, and it shows a one line summary of each commit
\r
553 in the chosen list of revisions. The summary includes commit date,
\r
554 author, and the first line of the log message. Additionally, any
\r
555 repository references, such as tags, will be shown.
\r
563 Presents a more rich view of the revision log showing the whole log
\r
564 message and the diffstat.
\r
572 Shows either the diff of the current working tree, that is, what
\r
573 has changed since the last commit, or the commit diff complete
\r
574 with log message, diffstat and diff.
\r
582 Lists directory trees associated with the current revision allowing
\r
583 subdirectories to be descended or ascended and file blobs to be
\r
592 Displays the file content or "blob" of data associated with a file
\r
601 Is used for displaying both input from stdin and output from git
\r
602 commands entered in the internal prompt.
\r
610 Displays key binding quick reference.
\r
614 <h3><a id="title-window"></a>3.3. Title Windows</h3>
\r
615 <p>Each view has a title window which shows the name of the view, current commit
\r
616 ID if available, and where the view is positioned:</p>
\r
617 <div class="listingblock">
\r
618 <div class="content">
\r
619 <pre><tt>[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)</tt></pre>
\r
621 <p>By default, the title of the current view is highlighted using bold font. For
\r
622 long loading views (taking over 3 seconds) the time since loading started will
\r
624 <div class="listingblock">
\r
625 <div class="content">
\r
626 <pre><tt>[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s</tt></pre>
\r
629 <h2><a id="keys"></a>4. Default Keybindings</h2>
\r
630 <div class="sectionbody">
\r
631 <p>Below the default key bindings are shown.</p>
\r
632 <h3><a id="view-switching"></a>4.1. View Switching</h3>
\r
633 <div class="tableblock">
\r
634 <table rules="none"
\r
636 cellspacing="0" cellpadding="4">
\r
638 <col width="788" />
\r
649 <tbody valign="top">
\r
655 Switch to main view.
\r
663 Switch to diff view.
\r
671 Switch to log view.
\r
679 Switch to pager view.
\r
687 Switch to (directory) tree view.
\r
695 Switch to (file) blob view.
\r
709 <h3><a id="view-manipulation"></a>4.2. View Manipulation</h3>
\r
710 <div class="tableblock">
\r
711 <table rules="none"
\r
713 cellspacing="0" cellpadding="4">
\r
715 <col width="788" />
\r
726 <tbody valign="top">
\r
732 Close view, if multiple views are open it will jump back to the previous view in the view stack. If it is the last open view it will quit. Use <em>Q</em> to quit all views at once.
\r
740 This key is "context sensitive" depending on what view you are currently in. When in log view on a commit line or in the main view, split the view and show the commit diff. In the diff view pressing Enter will simply scroll the view one line down.
\r
748 Switch to next view.
\r
756 This key is "context sensitive" and will move the cursor one line up. However, if you opened a diff view from the main view (split- or full-screen) it will change the cursor to point to the previous commit in the main view and update the diff view to display it.
\r
764 Similar to <em>Up</em> but will move down.
\r
770 <h3><a id="cursor-nav"></a>4.3. Cursor Navigation</h3>
\r
771 <div class="tableblock">
\r
772 <table rules="none"
\r
774 cellspacing="0" cellpadding="4">
\r
776 <col width="788" />
\r
787 <tbody valign="top">
\r
793 Move cursor one line up.
\r
801 Move cursor one line down.
\r
809 Move cursor one page up.
\r
817 Space Move cursor one page down.
\r
825 Jump to first line.
\r
839 <h3><a id="view-scrolling"></a>4.4. Scrolling</h3>
\r
840 <div class="tableblock">
\r
841 <table rules="none"
\r
843 cellspacing="0" cellpadding="4">
\r
845 <col width="788" />
\r
856 <tbody valign="top">
\r
862 Scroll view one line up.
\r
870 Scroll view one line down.
\r
878 Scroll view one page up.
\r
886 Scroll view one page down.
\r
892 <h3><a id="searching"></a>4.5. Searching</h3>
\r
893 <div class="tableblock">
\r
894 <table rules="none"
\r
896 cellspacing="0" cellpadding="4">
\r
898 <col width="788" />
\r
909 <tbody valign="top">
\r
915 Search the view. Opens a prompt for entering search regex to use.
\r
923 Search backwards in the view. Also prompts for regex.
\r
931 Find next match for the current search regex.
\r
939 Find previous match for the current search regex.
\r
945 <h3><a id="misc-keys"></a>4.6. Misc</h3>
\r
946 <div class="tableblock">
\r
947 <table rules="none"
\r
949 cellspacing="0" cellpadding="4">
\r
951 <col width="788" />
\r
962 <tbody valign="top">
\r
984 Stop all background loading. This can be useful if you use tig in a repository with a long history without limiting the revision log.
\r
1000 Toggle line numbers on/off.
\r
1008 Toggle revision graph visualization on/off.
\r
1016 Open prompt. This allows you to specify what git command to run. Example <tt>:log -p</tt>
\r
1023 <h2><a id="refspec"></a>5. Revision Specification</h2>
\r
1024 <div class="sectionbody">
\r
1025 <p>This section describes various ways to specify what revisions to display or
\r
1026 otherwise limit the view to. Tig does not itself parse the described
\r
1027 revision options so refer to the relevant git man pages for further
\r
1028 information. Relevant man pages besides git-log(1) are git-diff(1) and
\r
1029 git-rev-list(1).</p>
\r
1030 <p>You can tune the interaction with git by making use of the options explained
\r
1031 in this section. For example, by configuring the environment variables
\r
1032 described in the <a href="#history-commands">"History commands"</a> section.</p>
\r
1033 <h3><a id="path-limiting"></a>5.1. Limit by Path Name</h3>
\r
1034 <p>If you are interested only in those revisions that made changes to a specific
\r
1035 file (or even several files) list the files like this:</p>
\r
1036 <div class="listingblock">
\r
1037 <div class="content">
\r
1038 <pre><tt>$ tig log Makefile README</tt></pre>
\r
1040 <p>To avoid ambiguity with repository references such as tag name, be sure to
\r
1041 separate file names from other git options using "--". So if you have a file
\r
1042 named <em>master</em> it will clash with the reference named <em>master</em>, and thus you
\r
1043 will have to use:</p>
\r
1044 <div class="listingblock">
\r
1045 <div class="content">
\r
1046 <pre><tt>$ tig log -- master</tt></pre>
\r
1048 <div class="admonitionblock">
\r
1051 <div class="title">Note</div>
\r
1053 <td class="content">For the main view, avoiding ambiguity will in some cases require you to
\r
1054 specify two "--" options. The first will make tig stop option processing
\r
1055 and the latter will be passed to git log.</td>
\r
1058 <h3><a id="date-number-limiting"></a>5.2. Limit by Date or Number</h3>
\r
1059 <p>To speed up interaction with git, you can limit the amount of commits to show
\r
1060 both for the log and main view. Either limit by date using e.g.
\r
1061 <tt>—since=1.month</tt> or limit by the number of commits using <tt>-n400</tt>.</p>
\r
1062 <p>If you are only interested in changed that happened between two dates you can
\r
1064 <div class="listingblock">
\r
1065 <div class="content">
\r
1066 <pre><tt>$ tig -- --after="May 5th" --before="2006-05-16 15:44"</tt></pre>
\r
1068 <div class="admonitionblock">
\r
1071 <div class="title">Note</div>
\r
1073 <td class="content">If you want to avoid having to quote dates containing spaces you can use
\r
1074 "." instead, e.g. <tt>—after=May.5th</tt>.</td>
\r
1077 <h3><a id="commit-range-limiting"></a>5.3. Limiting by Commit Ranges</h3>
\r
1078 <p>Alternatively, commits can be limited to a specific range, such as "all
\r
1079 commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:</p>
\r
1080 <div class="listingblock">
\r
1081 <div class="content">
\r
1082 <pre><tt>$ tig log tag-1.0..tag-2.0</tt></pre>
\r
1084 <p>This way of commit limiting makes it trivial to only browse the commits which
\r
1085 haven't been pushed to a remote branch. Assuming <em>origin</em> is your upstream
\r
1086 remote branch, using:</p>
\r
1087 <div class="listingblock">
\r
1088 <div class="content">
\r
1089 <pre><tt>$ tig log origin..HEAD</tt></pre>
\r
1091 <p>will list what will be pushed to the remote branch. Optionally, the ending
\r
1092 <em>HEAD</em> can be left out since it is implied.</p>
\r
1093 <h3><a id="reachability-limiting"></a>5.4. Limiting by Reachability</h3>
\r
1094 <p>Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits
\r
1095 reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>". Where reachability refers
\r
1096 to what commits are ancestors (or part of the history) of the branch or tagged
\r
1097 revision in question.</p>
\r
1098 <p>If you prefer to specify which commit to preview in this way use the
\r
1100 <div class="listingblock">
\r
1101 <div class="content">
\r
1102 <pre><tt>$ tig log tag-2.0 ^tag-1.0</tt></pre>
\r
1104 <p>You can think of <em>^</em> as a negation operator. Using this alternate syntax, it
\r
1105 is possible to further prune commits by specifying multiple branch cut offs.</p>
\r
1106 <h3><a id="refspec-combi"></a>5.5. Combining Revisions Specification</h3>
\r
1107 <p>Revisions options can to some degree be combined, which makes it possible to
\r
1108 say "show at most 20 commits from within the last month that changed files
\r
1109 under the Documentation/ directory."</p>
\r
1110 <div class="listingblock">
\r
1111 <div class="content">
\r
1112 <pre><tt>$ tig -- --since=1.month -n20 -- Documentation/</tt></pre>
\r
1114 <h3><a id="refspec-all"></a>5.6. Examining All Repository References</h3>
\r
1115 <p>In some cases, it can be useful to query changes across all references in a
\r
1116 repository. An example is to ask "did any line of development in this
\r
1117 repository change a particular file within the last week". This can be
\r
1118 accomplished using:</p>
\r
1119 <div class="listingblock">
\r
1120 <div class="content">
\r
1121 <pre><tt>$ tig -- --all --since=1.week -- Makefile</tt></pre>
\r
1125 <div class="sectionbody">
\r
1126 <p>Known bugs and problems:</p>
\r
1130 Proper locale support: in it's current state tig is pretty much UTF-8 only.
\r
1135 Horizontal scrolling.
\r
1140 <h2><a id="copy-right"></a>7. Copyright</h2>
\r
1141 <div class="sectionbody">
\r
1142 <p>Copyright (c) 2006 Jonas Fonseca <fonseca@diku.dk></p>
\r
1143 <p>This program is free software; you can redistribute it and/or modify
\r
1144 it under the terms of the GNU General Public License as published by
\r
1145 the Free Software Foundation; either version 2 of the License, or
\r
1146 (at your option) any later version.</p>
\r
1148 <h2><a id="references"></a>8. References and Related Tools</h2>
\r
1149 <div class="sectionbody">
\r
1154 <a href="tig.1.html">tig(1)</a>
\r
1159 <a href="tigrc.5.html">tigrc(5)</a>
\r
1163 <p>Online resources:</p>
\r
1167 Homepage: <a href="http://jonas.nitro.dk/tig">http://jonas.nitro.dk/tig</a>
\r
1172 Manual: <a href="http://jonas.nitro.dk/tig/manual.html">http://jonas.nitro.dk/tig/manual.html</a>
\r
1177 Releases: <a href="http://jonas.nitro.dk/tig/releases">http://jonas.nitro.dk/tig/releases</a>
\r
1182 Git URL: <a href="http://jonas.nitro.dk/tig/tig.git">http://jonas.nitro.dk/tig/tig.git</a>
\r
1187 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>
\r
1191 <p>Git porcelains:</p>
\r
1195 <a href="http://www.kernel.org/pub/software/scm/git/docs/">git</a>,
\r
1200 <a href="http://www.kernel.org/pub/software/scm/cogito/docs/">Cogito</a>
\r
1204 <p>Other git repository browsers:</p>
\r
1224 <div id="footer-text">
\r
1225 Last updated 18-Sep-2006 18:23:56 CEST
\r