chiark / gitweb /
Sync docs
[tig] / manual.html
CommitLineData
3ad8214b
JF
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
4<head>\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
8/* Debug borders */\r
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
10/*\r
11 border: 1px solid red;\r
12*/\r
13}\r
14\r
15body {\r
16 margin: 1em 5% 1em 5%;\r
17}\r
18\r
19a { color: blue; }\r
20a:visited { color: fuchsia; }\r
21\r
22em {\r
23 font-style: italic;\r
24}\r
25\r
26strong {\r
27 font-weight: bold;\r
28}\r
29\r
30tt {\r
31 color: navy;\r
32}\r
33\r
34h1, h2, h3, h4, h5, h6 {\r
35 color: #527bbd;\r
36 font-family: sans-serif;\r
37 margin-top: 1.2em;\r
38 margin-bottom: 0.5em;\r
39 line-height: 1.3;\r
40}\r
41\r
42h1 {\r
43 border-bottom: 2px solid silver;\r
44}\r
45h2 {\r
46 border-bottom: 2px solid silver;\r
47 padding-top: 0.5em;\r
48}\r
49\r
50div.sectionbody {\r
51 font-family: serif;\r
52 margin-left: 0;\r
53}\r
54\r
55hr {\r
56 border: 1px solid silver;\r
57}\r
58\r
59p {\r
60 margin-top: 0.5em;\r
61 margin-bottom: 0.5em;\r
62}\r
63\r
64pre {\r
65 padding: 0;\r
66 margin: 0;\r
67}\r
68\r
69span#author {\r
70 color: #527bbd;\r
71 font-family: sans-serif;\r
72 font-weight: bold;\r
73 font-size: 1.2em;\r
74}\r
75span#email {\r
76}\r
77span#revision {\r
78 font-family: sans-serif;\r
79}\r
80\r
81div#footer {\r
82 font-family: sans-serif;\r
83 font-size: small;\r
84 border-top: 2px solid silver;\r
85 padding-top: 0.5em;\r
86 margin-top: 4.0em;\r
87}\r
88div#footer-text {\r
89 float: left;\r
90 padding-bottom: 0.5em;\r
91}\r
92div#footer-badges {\r
93 float: right;\r
94 padding-bottom: 0.5em;\r
95}\r
96\r
97div#preamble,\r
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,\r
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
100div.admonitionblock {\r
101 margin-right: 10%;\r
102 margin-top: 1.5em;\r
103 margin-bottom: 1.5em;\r
104}\r
105div.admonitionblock {\r
106 margin-top: 2.5em;\r
107 margin-bottom: 2.5em;\r
108}\r
109\r
110div.content { /* Block element content. */\r
111 padding: 0;\r
112}\r
113\r
114/* Block element titles. */\r
115div.title, caption.title {\r
116 font-family: sans-serif;\r
117 font-weight: bold;\r
118 text-align: left;\r
119 margin-top: 1.0em;\r
120 margin-bottom: 0.5em;\r
121}\r
122div.title + * {\r
123 margin-top: 0;\r
124}\r
125\r
126td div.title:first-child {\r
127 margin-top: 0.0em;\r
128}\r
129div.content div.title:first-child {\r
130 margin-top: 0.0em;\r
131}\r
132div.content + div.title {\r
133 margin-top: 0.0em;\r
134}\r
135\r
136div.sidebarblock > div.content {\r
137 background: #ffffee;\r
138 border: 1px solid silver;\r
139 padding: 0.5em;\r
140}\r
141\r
142div.listingblock > div.content {\r
143 border: 1px solid silver;\r
144 background: #f4f4f4;\r
145 padding: 0.5em;\r
146}\r
147\r
148div.quoteblock > div.content {\r
149 padding-left: 2.0em;\r
150}\r
151div.quoteblock .attribution {\r
152 text-align: right;\r
153}\r
154\r
155div.admonitionblock .icon {\r
156 vertical-align: top;\r
157 font-size: 1.1em;\r
158 font-weight: bold;\r
159 text-decoration: underline;\r
160 color: #527bbd;\r
161 padding-right: 0.5em;\r
162}\r
163div.admonitionblock td.content {\r
164 padding-left: 0.5em;\r
165 border-left: 2px solid silver;\r
166}\r
167\r
168div.exampleblock > div.content {\r
169 border-left: 2px solid silver;\r
170 padding: 0.5em;\r
171}\r
172\r
173div.verseblock div.content {\r
174 white-space: pre;\r
175}\r
176\r
177div.imageblock div.content { padding-left: 0; }\r
178div.imageblock img { border: 1px solid silver; }\r
179span.image img { border-style: none; }\r
180\r
181dl {\r
182 margin-top: 0.8em;\r
183 margin-bottom: 0.8em;\r
184}\r
185dt {\r
186 margin-top: 0.5em;\r
187 margin-bottom: 0;\r
188 font-style: italic;\r
189}\r
190dd > *:first-child {\r
191 margin-top: 0;\r
192}\r
193\r
194ul, ol {\r
195 list-style-position: outside;\r
196}\r
197ol.olist2 {\r
198 list-style-type: lower-alpha;\r
199}\r
200\r
201div.tableblock > table {\r
202 border-color: #527bbd;\r
203 border-width: 3px;\r
204}\r
205thead {\r
206 font-family: sans-serif;\r
207 font-weight: bold;\r
208}\r
209tfoot {\r
210 font-weight: bold;\r
211}\r
212\r
213div.hlist {\r
214 margin-top: 0.8em;\r
215 margin-bottom: 0.8em;\r
216}\r
217td.hlist1 {\r
218 vertical-align: top;\r
219 font-style: italic;\r
220 padding-right: 0.8em;\r
221}\r
222td.hlist2 {\r
223 vertical-align: top;\r
224}\r
225\r
226@media print {\r
227 div#footer-badges { display: none; }\r
228}\r
229/* Workarounds for IE6's broken and incomplete CSS2. */\r
230\r
231div.sidebar-content {\r
232 background: #ffffee;\r
233 border: 1px solid silver;\r
234 padding: 0.5em;\r
235}\r
236div.sidebar-title, div.image-title {\r
237 font-family: sans-serif;\r
238 font-weight: bold;\r
239 margin-top: 0.0em;\r
240 margin-bottom: 0.5em;\r
241}\r
242\r
243div.listingblock div.content {\r
244 border: 1px solid silver;\r
245 background: #f4f4f4;\r
246 padding: 0.5em;\r
247}\r
248\r
249div.quoteblock-content {\r
250 padding-left: 2.0em;\r
251}\r
252\r
253div.exampleblock-content {\r
254 border-left: 2px solid silver;\r
255 padding-left: 0.5em;\r
256}\r
257</style>\r
258<title>The tig Manual</title>\r
259</head>\r
260<body>\r
261<div id="header">\r
262<h1>The tig Manual</h1>\r
263<span id="author">Jonas Fonseca</span><br />\r
264<span id="email"><tt>&lt;<a href="mailto:fonseca@diku.dk">fonseca@diku.dk</a>&gt;</tt></span><br />\r
265</div>\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
269Tig allows you to browse changes in a git repository and can additionally act\r
270as a pager for output of various git commands. When used as a pager, it will\r
271display input from stdin and colorize it.</p>\r
272<p>When browsing repositories, tig uses the underlying git commands to present\r
273the user with various views, such as summarized commit log and showing the\r
274commit with the log message, diffstat, and the diff.</p>\r
b484cbc8
JF
275<p><strong>Table of Contents</strong></p>\r
276<ol>\r
277<li>\r
278<p>\r
279<a href="#calling-conventions">Calling Conventions</a>\r
280</p>\r
281<ul>\r
282<li>\r
283<p>\r
284<a href="#pager-mode">Pager Mode</a>\r
285</p>\r
286</li>\r
287<li>\r
288<p>\r
289<a href="#cmd-options">Git Command Options</a>\r
290</p>\r
291</li>\r
292</ul>\r
293</li>\r
294<li>\r
295<p>\r
296<a href="#env-variables">Environment Variables</a>\r
297</p>\r
298<ul>\r
299<li>\r
300<p>\r
301<a href="#repo-refs">Repository References</a>\r
302</p>\r
303</li>\r
304<li>\r
305<p>\r
306<a href="#history-commands">History Commands</a>\r
307</p>\r
308</li>\r
60e10e16
JF
309<li>\r
310<p>\r
311<a href="#tree-commands">Tree Commands</a>\r
312</p>\r
313</li>\r
b484cbc8
JF
314</ul>\r
315</li>\r
316<li>\r
317<p>\r
318<a href="#viewer">The Viewer</a>\r
319</p>\r
320<ul>\r
321<li>\r
322<p>\r
323<a href="#commit-id">Current Head and Commit ID</a>\r
324</p>\r
325</li>\r
326<li>\r
327<p>\r
328<a href="#views">Views</a>\r
329</p>\r
330</li>\r
331<li>\r
332<p>\r
333<a href="#title-window">Title Windows</a>\r
334</p>\r
335</li>\r
c3a4b3e0
JF
336</ul>\r
337</li>\r
338<li>\r
339<p>\r
340<a href="#keys">Default Keybindings</a>\r
341</p>\r
342<ul>\r
b484cbc8
JF
343<li>\r
344<p>\r
345<a href="#view-switching">View Switching</a>\r
346</p>\r
347</li>\r
348<li>\r
349<p>\r
350<a href="#view-manipulation">View Manipulation</a>\r
351</p>\r
352</li>\r
353<li>\r
354<p>\r
355<a href="#cursor-nav">Cursor Navigation</a>\r
356</p>\r
357</li>\r
358<li>\r
359<p>\r
360<a href="#view-scrolling">Scrolling</a>\r
361</p>\r
362</li>\r
af4c75a2
JF
363<li>\r
364<p>\r
365<a href="#searching">Searching</a>\r
366</p>\r
367</li>\r
b484cbc8
JF
368</ul>\r
369</li>\r
370<li>\r
371<p>\r
372<a href="#refspec">Revision Specification</a>\r
373</p>\r
374<ul>\r
375<li>\r
376<p>\r
377<a href="#path-limiting">Limit by Path Name</a>\r
378</p>\r
379</li>\r
380<li>\r
381<p>\r
382<a href="#date-number-limiting">Limit by Date or Number</a>\r
383</p>\r
384</li>\r
385<li>\r
386<p>\r
387<a href="#commit-range-limiting">Limiting by Commit Ranges</a>\r
388</p>\r
389</li>\r
390<li>\r
391<p>\r
392<a href="#reachability-limiting">Limiting by Reachability</a>\r
393</p>\r
394</li>\r
395<li>\r
396<p>\r
397<a href="#refspec-combi">Combining Revisions Specification</a>\r
398</p>\r
399</li>\r
400<li>\r
401<p>\r
402<a href="#refspec-all">Examining All Repository References</a>\r
403</p>\r
404</li>\r
405</ul>\r
406</li>\r
407<li>\r
408<p>\r
409<a href="#copy-right">Copyright</a>\r
410</p>\r
411</li>\r
412<li>\r
413<p>\r
414<a href="#references">References and Related Tools</a>\r
415</p>\r
416</li>\r
417</ol>\r
3ad8214b
JF
418</div>\r
419</div>\r
b484cbc8 420<h2><a id="calling-conventions"></a>1. Calling Conventions</h2>\r
3ad8214b 421<div class="sectionbody">\r
b484cbc8 422<h3><a id="pager-mode"></a>1.1. Pager Mode</h3>\r
3ad8214b
JF
423<p>If stdin is a pipe, any log or diff options will be ignored and the pager view\r
424will be opened loading data from stdin. The pager mode can be used for\r
425colorizing output from various git commands.</p>\r
426<p>Example on how to colorize the output of git-show(1):</p>\r
b484cbc8 427<div class="listingblock">\r
3ad8214b
JF
428<div class="content">\r
429<pre><tt>$ git show | tig</tt></pre>\r
430</div></div>\r
b484cbc8 431<h3><a id="cmd-options"></a>1.2. Git Command Options</h3>\r
3ad8214b
JF
432<p>All git command options specified on the command line will be passed to the\r
433given command and all will be shell quoted before they are passed to the\r
434shell.</p>\r
435<div class="admonitionblock">\r
436<table><tr>\r
437<td class="icon">\r
438<div class="title">Note</div>\r
439</td>\r
440<td class="content">If you specify options for the main view, you should not use the\r
441<tt>&#8212;pretty</tt> option as this option will be set automatically to the format\r
442expected by the main view.</td>\r
443</tr></table>\r
444</div>\r
445<p>Example on how to open the log view and show both author and committer\r
446information:</p>\r
b484cbc8 447<div class="listingblock">\r
3ad8214b
JF
448<div class="content">\r
449<pre><tt>$ tig log --pretty=fuller</tt></pre>\r
450</div></div>\r
451<p>See the <a href="#refspec">"Specifying revisions"</a> section below for an introduction\r
452to revision options supported by the git commands. For details on specific git\r
453command options, refer to the man page of the command in question.</p>\r
454</div>\r
b484cbc8 455<h2><a id="env-variables"></a>2. Environment Variables</h2>\r
3ad8214b
JF
456<div class="sectionbody">\r
457<p>Several options related to the interface with git can be configured via\r
458environment options.</p>\r
b484cbc8 459<h3><a id="repo-refs"></a>2.1. Repository References</h3>\r
3ad8214b
JF
460<p>Commits that are referenced by tags and branch heads will be marked by the\r
461reference name surrounded by <em>[</em> and <em>]</em>:</p>\r
b484cbc8 462<div class="listingblock">\r
3ad8214b
JF
463<div class="content">\r
464<pre><tt>2006-03-26 19:42 Petr Baudis | [cogito-0.17.1] Cogito 0.17.1</tt></pre>\r
465</div></div>\r
466<p>If you want to filter out certain directories under <tt>.git/refs/</tt>, say <tt>tmp</tt>\r
467you can do it by setting the following variable:</p>\r
b484cbc8 468<div class="listingblock">\r
3ad8214b
JF
469<div class="content">\r
470<pre><tt>$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig</tt></pre>\r
471</div></div>\r
472<p>Or set the variable permanently in your environment.</p>\r
473<dl>\r
474<dt>\r
475TIG_LS_REMOTE\r
476</dt>\r
477<dd>\r
478<p>\r
479 Set command for retrieving all repository references. The command\r
480 should output data in the same format as git-ls-remote(1).\r
481</p>\r
482</dd>\r
483</dl>\r
b484cbc8 484<h3><a id="history-commands"></a>2.2. History Commands</h3>\r
3ad8214b
JF
485<p>It is possible to alter which commands are used for the different views. If\r
486for example you prefer commits in the main view to be sorted by date and only\r
487show 500 commits, use:</p>\r
b484cbc8 488<div class="listingblock">\r
3ad8214b
JF
489<div class="content">\r
490<pre><tt>$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig</tt></pre>\r
491</div></div>\r
492<p>Or set the variable permanently in your environment.</p>\r
493<p>Notice, how <tt>%s</tt> is used to specify the commit reference. There can be a\r
494maximum of 5 <tt>%s</tt> ref specifications.</p>\r
495<dl>\r
496<dt>\r
497TIG_DIFF_CMD\r
498</dt>\r
499<dd>\r
500<p>\r
501 The command used for the diff view. By default, git show is used\r
502 as a backend.\r
503</p>\r
504</dd>\r
505<dt>\r
506TIG_LOG_CMD\r
507</dt>\r
508<dd>\r
509<p>\r
510 The command used for the log view. If you prefer to have both\r
511 author and committer shown in the log view be sure to pass\r
512 <tt>&#8212;pretty=fuller</tt> to git log.\r
513</p>\r
514</dd>\r
515<dt>\r
516TIG_MAIN_CMD\r
517</dt>\r
518<dd>\r
519<p>\r
520 The command used for the main view. Note, you must always specify\r
521 the option: <tt>&#8212;pretty=raw</tt> since the main view parser expects to\r
522 read that format.\r
523</p>\r
524</dd>\r
525</dl>\r
60e10e16
JF
526<h3><a id="tree-commands"></a>2.3. Tree Commands</h3>\r
527<dl>\r
528<dt>\r
529TIG_TREE_CMD\r
530</dt>\r
531<dd>\r
532<p>\r
533 The command used for the tree view. Takes two arguments, the first\r
534 is the revision ID and the second is the path of the directory tree,\r
535 empty for the root directory. Defaults to "git ls-tree %s %s".\r
536</p>\r
537</dd>\r
538<dt>\r
539TIG_BLOB_CMD\r
540</dt>\r
541<dd>\r
542<p>\r
543 The command used for the blob view. Takes one argument which is\r
544 the blob ID. Defaults to "git cat-file blob %s".\r
545</p>\r
546</dd>\r
547</dl>\r
3ad8214b 548</div>\r
b484cbc8 549<h2><a id="viewer"></a>3. The Viewer</h2>\r
3ad8214b
JF
550<div class="sectionbody">\r
551<p>The display consists of a status window on the last line of the screen and one\r
552or more views. The default is to only show one view at the time but it is\r
553possible to split both the main and log view to also show the commit diff.</p>\r
554<p>If you are in the log view and press <em>Enter</em> when the current line is a commit\r
555line, such as:</p>\r
b484cbc8 556<div class="listingblock">\r
3ad8214b
JF
557<div class="content">\r
558<pre><tt>commit 4d55caff4cc89335192f3e566004b4ceef572521</tt></pre>\r
559</div></div>\r
560<p>You will split the view so that the log view is displayed in the top window\r
561and the diff view in the bottom window. You can switch between the two views\r
562by pressing <em>Tab</em>. To maximize the log view again, simply press <em>l</em>.</p>\r
b484cbc8 563<h3><a id="commit-id"></a>3.1. Current Head and Commit ID</h3>\r
3ad8214b 564<p>The viewer keeps track of both what head and commit ID you are currently\r
af4c75a2 565viewing. The commit ID will follow the cursor line and change every time\r
3ad8214b
JF
566you highlight a different commit. Whenever you reopen the diff view it will be\r
567reloaded, if the commit ID changed.</p>\r
568<p>The head ID is used when opening the main and log view to indicate from what\r
569revision to show history.</p>\r
b484cbc8
JF
570<h3><a id="views"></a>3.2. Views</h3>\r
571<p>Various <em>views</em> of a repository is presented. Each view is based on output\r
3ad8214b
JF
572from an external command, most often <em>git log</em>, <em>git diff</em>, or <em>git show</em>.</p>\r
573<dl>\r
574<dt>\r
575The main view\r
576</dt>\r
577<dd>\r
578<p>\r
579 Is the default view, and it shows a one line summary of each commit\r
580 in the chosen list of revisions. The summary includes commit date,\r
581 author, and the first line of the log message. Additionally, any\r
582 repository references, such as tags, will be shown.\r
583</p>\r
584</dd>\r
585<dt>\r
586The log view\r
587</dt>\r
588<dd>\r
589<p>\r
590 Presents a more rich view of the revision log showing the whole log\r
591 message and the diffstat.\r
592</p>\r
593</dd>\r
594<dt>\r
595The diff view\r
596</dt>\r
597<dd>\r
598<p>\r
599 Shows either the diff of the current working tree, that is, what\r
600 has changed since the last commit, or the commit diff complete\r
601 with log message, diffstat and diff.\r
602</p>\r
603</dd>\r
604<dt>\r
af4c75a2
JF
605The tree view\r
606</dt>\r
607<dd>\r
608<p>\r
609 Lists directory trees associated with the current revision allowing\r
610 subdirectories to be descended or ascended and file blobs to be\r
611 viewed.\r
612</p>\r
613</dd>\r
614<dt>\r
615The blob view\r
616</dt>\r
617<dd>\r
618<p>\r
619 Displays the file content or "blob" of data associated with a file\r
620 name.\r
621</p>\r
622</dd>\r
623<dt>\r
3ad8214b
JF
624The pager view\r
625</dt>\r
626<dd>\r
627<p>\r
628 Is used for displaying both input from stdin and output from git\r
629 commands entered in the internal prompt.\r
630</p>\r
631</dd>\r
632<dt>\r
633The help view\r
634</dt>\r
635<dd>\r
636<p>\r
42afc55b 637 Displays key binding quick reference.\r
3ad8214b
JF
638</p>\r
639</dd>\r
640</dl>\r
b484cbc8 641<h3><a id="title-window"></a>3.3. Title Windows</h3>\r
3ad8214b
JF
642<p>Each view has a title window which shows the name of the view, current commit\r
643ID if available, and where the view is positioned:</p>\r
b484cbc8 644<div class="listingblock">\r
3ad8214b
JF
645<div class="content">\r
646<pre><tt>[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)</tt></pre>\r
647</div></div>\r
648<p>By default, the title of the current view is highlighted using bold font. For\r
649long loading views (taking over 3 seconds) the time since loading started will\r
650be appended:</p>\r
b484cbc8 651<div class="listingblock">\r
3ad8214b
JF
652<div class="content">\r
653<pre><tt>[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s</tt></pre>\r
654</div></div>\r
655</div>\r
c3a4b3e0 656<h2><a id="keys"></a>4. Default Keybindings</h2>\r
3ad8214b
JF
657<div class="sectionbody">\r
658<p>Below the default key bindings are shown.</p>\r
b484cbc8 659<h3><a id="view-switching"></a>4.1. View Switching</h3>\r
c3a4b3e0
JF
660<div class="tableblock">\r
661<table rules="none"\r
662frame="hsides"\r
663cellspacing="0" cellpadding="4">\r
664<col width="91" />\r
665<col width="788" />\r
666<thead>\r
667 <tr>\r
668 <th align="left">\r
669 Key\r
670 </th>\r
671 <th align="left">\r
672 Action\r
673 </th>\r
674 </tr>\r
675</thead>\r
676<tbody valign="top">\r
677 <tr>\r
678 <td align="left">\r
679 m\r
680 </td>\r
681 <td align="left">\r
682 Switch to main view.\r
683 </td>\r
684 </tr>\r
685 <tr>\r
686 <td align="left">\r
687 d\r
688 </td>\r
689 <td align="left">\r
690 Switch to diff view.\r
691 </td>\r
692 </tr>\r
693 <tr>\r
694 <td align="left">\r
695 l\r
696 </td>\r
697 <td align="left">\r
698 Switch to log view.\r
699 </td>\r
700 </tr>\r
701 <tr>\r
702 <td align="left">\r
703 p\r
704 </td>\r
705 <td align="left">\r
706 Switch to pager view.\r
707 </td>\r
708 </tr>\r
709 <tr>\r
710 <td align="left">\r
af4c75a2
JF
711 t\r
712 </td>\r
713 <td align="left">\r
714 Switch to (directory) tree view.\r
715 </td>\r
716 </tr>\r
717 <tr>\r
718 <td align="left">\r
719 f\r
720 </td>\r
721 <td align="left">\r
722 Switch to (file) blob view.\r
723 </td>\r
724 </tr>\r
725 <tr>\r
726 <td align="left">\r
727 h\r
c3a4b3e0
JF
728 </td>\r
729 <td align="left">\r
730 Show man page.\r
731 </td>\r
732 </tr>\r
733</tbody>\r
734</table>\r
735</div>\r
b484cbc8 736<h3><a id="view-manipulation"></a>4.2. View Manipulation</h3>\r
c3a4b3e0
JF
737<div class="tableblock">\r
738<table rules="none"\r
739frame="hsides"\r
740cellspacing="0" cellpadding="4">\r
741<col width="91" />\r
742<col width="788" />\r
743<thead>\r
744 <tr>\r
745 <th align="left">\r
746 Key\r
747 </th>\r
748 <th align="left">\r
749 Action\r
750 </th>\r
751 </tr>\r
752</thead>\r
753<tbody valign="top">\r
754 <tr>\r
755 <td align="left">\r
756 q\r
757 </td>\r
758 <td align="left">\r
759 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
760 </td>\r
761 </tr>\r
762 <tr>\r
763 <td align="left">\r
764 Enter\r
765 </td>\r
766 <td align="left">\r
767 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
768 </td>\r
769 </tr>\r
770 <tr>\r
771 <td align="left">\r
772 Tab\r
773 </td>\r
774 <td align="left">\r
775 Switch to next view.\r
776 </td>\r
777 </tr>\r
778 <tr>\r
779 <td align="left">\r
780 Up\r
781 </td>\r
782 <td align="left">\r
af4c75a2 783 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
c3a4b3e0
JF
784 </td>\r
785 </tr>\r
786 <tr>\r
787 <td align="left">\r
788 Down\r
789 </td>\r
790 <td align="left">\r
791 Similar to <em>Up</em> but will move down.\r
792 </td>\r
793 </tr>\r
794</tbody>\r
795</table>\r
796</div>\r
b484cbc8 797<h3><a id="cursor-nav"></a>4.3. Cursor Navigation</h3>\r
c3a4b3e0
JF
798<div class="tableblock">\r
799<table rules="none"\r
800frame="hsides"\r
801cellspacing="0" cellpadding="4">\r
802<col width="91" />\r
803<col width="788" />\r
804<thead>\r
805 <tr>\r
806 <th align="left">\r
807 Key\r
808 </th>\r
809 <th align="left">\r
810 Action\r
811 </th>\r
812 </tr>\r
813</thead>\r
814<tbody valign="top">\r
815 <tr>\r
816 <td align="left">\r
817 j\r
818 </td>\r
819 <td align="left">\r
820 Move cursor one line up.\r
821 </td>\r
822 </tr>\r
823 <tr>\r
824 <td align="left">\r
825 k\r
826 </td>\r
827 <td align="left">\r
828 Move cursor one line down.\r
829 </td>\r
830 </tr>\r
831 <tr>\r
832 <td align="left">\r
5c09dc14 833 PgUp,-,a\r
c3a4b3e0
JF
834 </td>\r
835 <td align="left">\r
836 Move cursor one page up.\r
837 </td>\r
838 </tr>\r
839 <tr>\r
840 <td align="left">\r
841 PgDown\r
842 </td>\r
843 <td align="left">\r
844 Space Move cursor one page down.\r
845 </td>\r
846 </tr>\r
847 <tr>\r
848 <td align="left">\r
849 Home\r
850 </td>\r
851 <td align="left">\r
852 Jump to first line.\r
853 </td>\r
854 </tr>\r
855 <tr>\r
856 <td align="left">\r
857 End\r
858 </td>\r
859 <td align="left">\r
860 Jump to last line.\r
861 </td>\r
862 </tr>\r
863</tbody>\r
864</table>\r
865</div>\r
b484cbc8 866<h3><a id="view-scrolling"></a>4.4. Scrolling</h3>\r
c3a4b3e0
JF
867<div class="tableblock">\r
868<table rules="none"\r
869frame="hsides"\r
870cellspacing="0" cellpadding="4">\r
871<col width="91" />\r
872<col width="788" />\r
873<thead>\r
874 <tr>\r
875 <th align="left">\r
876 Key\r
877 </th>\r
878 <th align="left">\r
879 Action\r
880 </th>\r
881 </tr>\r
882</thead>\r
883<tbody valign="top">\r
884 <tr>\r
885 <td align="left">\r
886 Insert\r
887 </td>\r
888 <td align="left">\r
889 Scroll view one line up.\r
890 </td>\r
891 </tr>\r
892 <tr>\r
893 <td align="left">\r
894 Delete\r
895 </td>\r
896 <td align="left">\r
897 Scroll view one line down.\r
898 </td>\r
899 </tr>\r
900 <tr>\r
901 <td align="left">\r
902 w\r
903 </td>\r
904 <td align="left">\r
905 Scroll view one page up.\r
906 </td>\r
907 </tr>\r
908 <tr>\r
909 <td align="left">\r
910 s\r
911 </td>\r
912 <td align="left">\r
913 Scroll view one page down.\r
914 </td>\r
915 </tr>\r
916</tbody>\r
917</table>\r
918</div>\r
af4c75a2
JF
919<h3><a id="searching"></a>4.5. Searching</h3>\r
920<div class="tableblock">\r
921<table rules="none"\r
922frame="hsides"\r
923cellspacing="0" cellpadding="4">\r
924<col width="91" />\r
925<col width="788" />\r
926<thead>\r
927 <tr>\r
928 <th align="left">\r
929 Key\r
930 </th>\r
931 <th align="left">\r
932 Action\r
933 </th>\r
934 </tr>\r
935</thead>\r
936<tbody valign="top">\r
937 <tr>\r
938 <td align="left">\r
939 /\r
940 </td>\r
941 <td align="left">\r
942 Search the view. Opens a prompt for entering search regex to use.\r
943 </td>\r
944 </tr>\r
945 <tr>\r
946 <td align="left">\r
947 ?\r
948 </td>\r
949 <td align="left">\r
950 Search backwards in the view. Also prompts for regex.\r
951 </td>\r
952 </tr>\r
953 <tr>\r
954 <td align="left">\r
955 n\r
956 </td>\r
957 <td align="left">\r
958 Find next match for the current search regex.\r
959 </td>\r
960 </tr>\r
961 <tr>\r
962 <td align="left">\r
963 N\r
964 </td>\r
965 <td align="left">\r
966 Find previous match for the current search regex.\r
967 </td>\r
968 </tr>\r
969</tbody>\r
970</table>\r
971</div>\r
972<h3><a id="misc-keys"></a>4.6. Misc</h3>\r
c3a4b3e0
JF
973<div class="tableblock">\r
974<table rules="none"\r
975frame="hsides"\r
976cellspacing="0" cellpadding="4">\r
977<col width="91" />\r
978<col width="788" />\r
979<thead>\r
980 <tr>\r
981 <th align="left">\r
982 Key\r
983 </th>\r
984 <th align="left">\r
985 Action\r
986 </th>\r
987 </tr>\r
988</thead>\r
989<tbody valign="top">\r
990 <tr>\r
991 <td align="left">\r
992 Q\r
993 </td>\r
994 <td align="left">\r
995 Quit.\r
996 </td>\r
997 </tr>\r
998 <tr>\r
999 <td align="left">\r
1000 r\r
1001 </td>\r
1002 <td align="left">\r
1003 Redraw screen.\r
1004 </td>\r
1005 </tr>\r
1006 <tr>\r
1007 <td align="left">\r
1008 z\r
1009 </td>\r
1010 <td align="left">\r
1011 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
1012 </td>\r
1013 </tr>\r
1014 <tr>\r
1015 <td align="left">\r
1016 v\r
1017 </td>\r
1018 <td align="left">\r
1019 Show version.\r
1020 </td>\r
1021 </tr>\r
1022 <tr>\r
1023 <td align="left">\r
af4c75a2 1024 <em>.</em>\r
c3a4b3e0
JF
1025 </td>\r
1026 <td align="left">\r
1027 Toggle line numbers on/off.\r
1028 </td>\r
1029 </tr>\r
1030 <tr>\r
1031 <td align="left">\r
1032 g\r
1033 </td>\r
1034 <td align="left">\r
1035 Toggle revision graph visualization on/off.\r
1036 </td>\r
1037 </tr>\r
1038 <tr>\r
1039 <td align="left">\r
1040 <em>:</em>\r
1041 </td>\r
1042 <td align="left">\r
1043 Open prompt. This allows you to specify what git command to run. Example <tt>:log -p</tt>\r
1044 </td>\r
1045 </tr>\r
1046</tbody>\r
1047</table>\r
1048</div>\r
3ad8214b 1049</div>\r
b484cbc8 1050<h2><a id="refspec"></a>5. Revision Specification</h2>\r
3ad8214b
JF
1051<div class="sectionbody">\r
1052<p>This section describes various ways to specify what revisions to display or\r
b484cbc8 1053otherwise limit the view to. Tig does not itself parse the described\r
af4c75a2 1054revision options so refer to the relevant git man pages for further\r
3ad8214b
JF
1055information. Relevant man pages besides git-log(1) are git-diff(1) and\r
1056git-rev-list(1).</p>\r
1057<p>You can tune the interaction with git by making use of the options explained\r
1058in this section. For example, by configuring the environment variables\r
1059described in the <a href="#history-commands">"History commands"</a> section.</p>\r
b484cbc8 1060<h3><a id="path-limiting"></a>5.1. Limit by Path Name</h3>\r
3ad8214b
JF
1061<p>If you are interested only in those revisions that made changes to a specific\r
1062file (or even several files) list the files like this:</p>\r
b484cbc8 1063<div class="listingblock">\r
3ad8214b
JF
1064<div class="content">\r
1065<pre><tt>$ tig log Makefile README</tt></pre>\r
1066</div></div>\r
1067<p>To avoid ambiguity with repository references such as tag name, be sure to\r
1068separate file names from other git options using "--". So if you have a file\r
1069named <em>master</em> it will clash with the reference named <em>master</em>, and thus you\r
1070will have to use:</p>\r
b484cbc8 1071<div class="listingblock">\r
3ad8214b
JF
1072<div class="content">\r
1073<pre><tt>$ tig log -- master</tt></pre>\r
1074</div></div>\r
1075<div class="admonitionblock">\r
1076<table><tr>\r
1077<td class="icon">\r
1078<div class="title">Note</div>\r
1079</td>\r
1080<td class="content">For the main view, avoiding ambiguity will in some cases require you to\r
b484cbc8 1081specify two "--" options. The first will make tig stop option processing\r
3ad8214b
JF
1082and the latter will be passed to git log.</td>\r
1083</tr></table>\r
1084</div>\r
b484cbc8 1085<h3><a id="date-number-limiting"></a>5.2. Limit by Date or Number</h3>\r
3ad8214b
JF
1086<p>To speed up interaction with git, you can limit the amount of commits to show\r
1087both for the log and main view. Either limit by date using e.g.\r
1088<tt>&#8212;since=1.month</tt> or limit by the number of commits using <tt>-n400</tt>.</p>\r
1089<p>If you are only interested in changed that happened between two dates you can\r
1090use:</p>\r
b484cbc8 1091<div class="listingblock">\r
3ad8214b
JF
1092<div class="content">\r
1093<pre><tt>$ tig -- --after="May 5th" --before="2006-05-16 15:44"</tt></pre>\r
1094</div></div>\r
1095<div class="admonitionblock">\r
1096<table><tr>\r
1097<td class="icon">\r
1098<div class="title">Note</div>\r
1099</td>\r
1100<td class="content">If you want to avoid having to quote dates containing spaces you can use\r
1101"." instead, e.g. <tt>&#8212;after=May.5th</tt>.</td>\r
1102</tr></table>\r
1103</div>\r
b484cbc8 1104<h3><a id="commit-range-limiting"></a>5.3. Limiting by Commit Ranges</h3>\r
3ad8214b
JF
1105<p>Alternatively, commits can be limited to a specific range, such as "all\r
1106commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:</p>\r
b484cbc8 1107<div class="listingblock">\r
3ad8214b
JF
1108<div class="content">\r
1109<pre><tt>$ tig log tag-1.0..tag-2.0</tt></pre>\r
1110</div></div>\r
1111<p>This way of commit limiting makes it trivial to only browse the commits which\r
1112haven't been pushed to a remote branch. Assuming <em>origin</em> is your upstream\r
1113remote branch, using:</p>\r
b484cbc8 1114<div class="listingblock">\r
3ad8214b
JF
1115<div class="content">\r
1116<pre><tt>$ tig log origin..HEAD</tt></pre>\r
1117</div></div>\r
1118<p>will list what will be pushed to the remote branch. Optionally, the ending\r
1119<em>HEAD</em> can be left out since it is implied.</p>\r
b484cbc8 1120<h3><a id="reachability-limiting"></a>5.4. Limiting by Reachability</h3>\r
3ad8214b
JF
1121<p>Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits\r
1122reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>". Where reachability refers\r
1123to what commits are ancestors (or part of the history) of the branch or tagged\r
1124revision in question.</p>\r
1125<p>If you prefer to specify which commit to preview in this way use the\r
1126following:</p>\r
b484cbc8 1127<div class="listingblock">\r
3ad8214b
JF
1128<div class="content">\r
1129<pre><tt>$ tig log tag-2.0 ^tag-1.0</tt></pre>\r
1130</div></div>\r
1131<p>You can think of <em>^</em> as a negation operator. Using this alternate syntax, it\r
1132is possible to further prune commits by specifying multiple branch cut offs.</p>\r
b484cbc8 1133<h3><a id="refspec-combi"></a>5.5. Combining Revisions Specification</h3>\r
3ad8214b
JF
1134<p>Revisions options can to some degree be combined, which makes it possible to\r
1135say "show at most 20 commits from within the last month that changed files\r
1136under the Documentation/ directory."</p>\r
b484cbc8 1137<div class="listingblock">\r
3ad8214b
JF
1138<div class="content">\r
1139<pre><tt>$ tig -- --since=1.month -n20 -- Documentation/</tt></pre>\r
1140</div></div>\r
b484cbc8 1141<h3><a id="refspec-all"></a>5.6. Examining All Repository References</h3>\r
3ad8214b
JF
1142<p>In some cases, it can be useful to query changes across all references in a\r
1143repository. An example is to ask "did any line of development in this\r
1144repository change a particular file within the last week". This can be\r
1145accomplished using:</p>\r
b484cbc8 1146<div class="listingblock">\r
3ad8214b
JF
1147<div class="content">\r
1148<pre><tt>$ tig -- --all --since=1.week -- Makefile</tt></pre>\r
1149</div></div>\r
1150</div>\r
b484cbc8 1151<h2>6. BUGS</h2>\r
3ad8214b
JF
1152<div class="sectionbody">\r
1153<p>Known bugs and problems:</p>\r
1154<ul>\r
1155<li>\r
1156<p>\r
af4c75a2 1157Proper locale support: in it's current state tig is pretty much UTF-8 only.\r
3ad8214b
JF
1158</p>\r
1159</li>\r
1160<li>\r
1161<p>\r
af4c75a2 1162Horizontal scrolling.\r
3ad8214b
JF
1163</p>\r
1164</li>\r
3ad8214b
JF
1165</ul>\r
1166</div>\r
b484cbc8 1167<h2><a id="copy-right"></a>7. Copyright</h2>\r
3ad8214b
JF
1168<div class="sectionbody">\r
1169<p>Copyright (c) 2006 Jonas Fonseca &lt;fonseca@diku.dk&gt;</p>\r
1170<p>This program is free software; you can redistribute it and/or modify\r
1171it under the terms of the GNU General Public License as published by\r
1172the Free Software Foundation; either version 2 of the License, or\r
1173(at your option) any later version.</p>\r
1174</div>\r
b484cbc8 1175<h2><a id="references"></a>8. References and Related Tools</h2>\r
3ad8214b 1176<div class="sectionbody">\r
b484cbc8
JF
1177<p>Manpages:</p>\r
1178<ul>\r
1179<li>\r
1180<p>\r
1181<a href="tig.1.html">tig(1)</a>\r
1182</p>\r
1183</li>\r
1184<li>\r
1185<p>\r
1186<a href="tigrc.5.html">tigrc(5)</a>\r
1187</p>\r
1188</li>\r
1189</ul>\r
1190<p>Online resources:</p>\r
3ad8214b
JF
1191<ul>\r
1192<li>\r
1193<p>\r
60e10e16 1194Homepage: <a href="http://jonas.nitro.dk/tig">http://jonas.nitro.dk/tig</a>\r
3ad8214b
JF
1195</p>\r
1196</li>\r
1197<li>\r
1198<p>\r
60e10e16 1199Manual: <a href="http://jonas.nitro.dk/tig/manual.html">http://jonas.nitro.dk/tig/manual.html</a>\r
5c09dc14
JF
1200</p>\r
1201</li>\r
1202<li>\r
1203<p>\r
60e10e16 1204Releases: <a href="http://jonas.nitro.dk/tig/releases">http://jonas.nitro.dk/tig/releases</a>\r
3ad8214b
JF
1205</p>\r
1206</li>\r
1207<li>\r
1208<p>\r
60e10e16
JF
1209Git URL: <a href="http://jonas.nitro.dk/tig/tig.git">http://jonas.nitro.dk/tig/tig.git</a> or\r
1210 git://repo.or.cz/tig.git\r
3ad8214b
JF
1211</p>\r
1212</li>\r
1213<li>\r
1214<p>\r
60e10e16 1215Gitweb: <a href="http://repo.or.cz/?p=tig.git;a=summary">http://repo.or.cz/?p=tig.git;a=summary</a>\r
3ad8214b
JF
1216</p>\r
1217</li>\r
1218</ul>\r
1219<p>Git porcelains:</p>\r
1220<ul>\r
1221<li>\r
1222<p>\r
1223<a href="http://www.kernel.org/pub/software/scm/git/docs/">git</a>,\r
1224</p>\r
1225</li>\r
1226<li>\r
1227<p>\r
1228<a href="http://www.kernel.org/pub/software/scm/cogito/docs/">Cogito</a>\r
1229</p>\r
1230</li>\r
1231</ul>\r
1232<p>Other git repository browsers:</p>\r
1233<ul>\r
1234<li>\r
1235<p>\r
1236gitk(1)\r
1237</p>\r
1238</li>\r
1239<li>\r
1240<p>\r
1241qgit(1)\r
1242</p>\r
1243</li>\r
1244<li>\r
1245<p>\r
1246gitview(1)\r
1247</p>\r
1248</li>\r
1249</ul>\r
1250</div>\r
1251<div id="footer">\r
1252<div id="footer-text">\r
60e10e16 1253Last updated 25-Sep-2006 01:14:32 CEST\r
3ad8214b
JF
1254</div>\r
1255</div>\r
1256</body>\r
1257</html>\r