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
309</ul>\r
310</li>\r
311<li>\r
312<p>\r
313<a href="#viewer">The Viewer</a>\r
314</p>\r
315<ul>\r
316<li>\r
317<p>\r
318<a href="#commit-id">Current Head and Commit ID</a>\r
319</p>\r
320</li>\r
321<li>\r
322<p>\r
323<a href="#views">Views</a>\r
324</p>\r
325</li>\r
326<li>\r
327<p>\r
328<a href="#title-window">Title Windows</a>\r
329</p>\r
330</li>\r
c3a4b3e0
JF
331</ul>\r
332</li>\r
333<li>\r
334<p>\r
335<a href="#keys">Default Keybindings</a>\r
336</p>\r
337<ul>\r
b484cbc8
JF
338<li>\r
339<p>\r
340<a href="#view-switching">View Switching</a>\r
341</p>\r
342</li>\r
343<li>\r
344<p>\r
345<a href="#view-manipulation">View Manipulation</a>\r
346</p>\r
347</li>\r
348<li>\r
349<p>\r
350<a href="#cursor-nav">Cursor Navigation</a>\r
351</p>\r
352</li>\r
353<li>\r
354<p>\r
355<a href="#view-scrolling">Scrolling</a>\r
356</p>\r
357</li>\r
af4c75a2
JF
358<li>\r
359<p>\r
360<a href="#searching">Searching</a>\r
361</p>\r
362</li>\r
b484cbc8
JF
363</ul>\r
364</li>\r
365<li>\r
366<p>\r
367<a href="#refspec">Revision Specification</a>\r
368</p>\r
369<ul>\r
370<li>\r
371<p>\r
372<a href="#path-limiting">Limit by Path Name</a>\r
373</p>\r
374</li>\r
375<li>\r
376<p>\r
377<a href="#date-number-limiting">Limit by Date or Number</a>\r
378</p>\r
379</li>\r
380<li>\r
381<p>\r
382<a href="#commit-range-limiting">Limiting by Commit Ranges</a>\r
383</p>\r
384</li>\r
385<li>\r
386<p>\r
387<a href="#reachability-limiting">Limiting by Reachability</a>\r
388</p>\r
389</li>\r
390<li>\r
391<p>\r
392<a href="#refspec-combi">Combining Revisions Specification</a>\r
393</p>\r
394</li>\r
395<li>\r
396<p>\r
397<a href="#refspec-all">Examining All Repository References</a>\r
398</p>\r
399</li>\r
400</ul>\r
401</li>\r
402<li>\r
403<p>\r
404<a href="#copy-right">Copyright</a>\r
405</p>\r
406</li>\r
407<li>\r
408<p>\r
409<a href="#references">References and Related Tools</a>\r
410</p>\r
411</li>\r
412</ol>\r
3ad8214b
JF
413</div>\r
414</div>\r
b484cbc8 415<h2><a id="calling-conventions"></a>1. Calling Conventions</h2>\r
3ad8214b 416<div class="sectionbody">\r
b484cbc8 417<h3><a id="pager-mode"></a>1.1. Pager Mode</h3>\r
3ad8214b
JF
418<p>If stdin is a pipe, any log or diff options will be ignored and the pager view\r
419will be opened loading data from stdin. The pager mode can be used for\r
420colorizing output from various git commands.</p>\r
421<p>Example on how to colorize the output of git-show(1):</p>\r
b484cbc8 422<div class="listingblock">\r
3ad8214b
JF
423<div class="content">\r
424<pre><tt>$ git show | tig</tt></pre>\r
425</div></div>\r
b484cbc8 426<h3><a id="cmd-options"></a>1.2. Git Command Options</h3>\r
3ad8214b
JF
427<p>All git command options specified on the command line will be passed to the\r
428given command and all will be shell quoted before they are passed to the\r
429shell.</p>\r
430<div class="admonitionblock">\r
431<table><tr>\r
432<td class="icon">\r
433<div class="title">Note</div>\r
434</td>\r
435<td class="content">If you specify options for the main view, you should not use the\r
436<tt>&#8212;pretty</tt> option as this option will be set automatically to the format\r
437expected by the main view.</td>\r
438</tr></table>\r
439</div>\r
440<p>Example on how to open the log view and show both author and committer\r
441information:</p>\r
b484cbc8 442<div class="listingblock">\r
3ad8214b
JF
443<div class="content">\r
444<pre><tt>$ tig log --pretty=fuller</tt></pre>\r
445</div></div>\r
446<p>See the <a href="#refspec">"Specifying revisions"</a> section below for an introduction\r
447to revision options supported by the git commands. For details on specific git\r
448command options, refer to the man page of the command in question.</p>\r
449</div>\r
b484cbc8 450<h2><a id="env-variables"></a>2. Environment Variables</h2>\r
3ad8214b
JF
451<div class="sectionbody">\r
452<p>Several options related to the interface with git can be configured via\r
453environment options.</p>\r
b484cbc8 454<h3><a id="repo-refs"></a>2.1. Repository References</h3>\r
3ad8214b
JF
455<p>Commits that are referenced by tags and branch heads will be marked by the\r
456reference name surrounded by <em>[</em> and <em>]</em>:</p>\r
b484cbc8 457<div class="listingblock">\r
3ad8214b
JF
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
460</div></div>\r
461<p>If you want to filter out certain directories under <tt>.git/refs/</tt>, say <tt>tmp</tt>\r
462you can do it by setting the following variable:</p>\r
b484cbc8 463<div class="listingblock">\r
3ad8214b
JF
464<div class="content">\r
465<pre><tt>$ TIG_LS_REMOTE="git ls-remote . | sed /\/tmp\//d" tig</tt></pre>\r
466</div></div>\r
467<p>Or set the variable permanently in your environment.</p>\r
468<dl>\r
469<dt>\r
470TIG_LS_REMOTE\r
471</dt>\r
472<dd>\r
473<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
476</p>\r
477</dd>\r
478</dl>\r
b484cbc8 479<h3><a id="history-commands"></a>2.2. History Commands</h3>\r
3ad8214b
JF
480<p>It is possible to alter which commands are used for the different views. If\r
481for example you prefer commits in the main view to be sorted by date and only\r
482show 500 commits, use:</p>\r
b484cbc8 483<div class="listingblock">\r
3ad8214b
JF
484<div class="content">\r
485<pre><tt>$ TIG_MAIN_CMD="git log --date-order -n500 --pretty=raw %s" tig</tt></pre>\r
486</div></div>\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
489maximum of 5 <tt>%s</tt> ref specifications.</p>\r
490<dl>\r
491<dt>\r
492TIG_DIFF_CMD\r
493</dt>\r
494<dd>\r
495<p>\r
496 The command used for the diff view. By default, git show is used\r
497 as a backend.\r
498</p>\r
499</dd>\r
500<dt>\r
501TIG_LOG_CMD\r
502</dt>\r
503<dd>\r
504<p>\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>&#8212;pretty=fuller</tt> to git log.\r
508</p>\r
509</dd>\r
510<dt>\r
511TIG_MAIN_CMD\r
512</dt>\r
513<dd>\r
514<p>\r
515 The command used for the main view. Note, you must always specify\r
516 the option: <tt>&#8212;pretty=raw</tt> since the main view parser expects to\r
517 read that format.\r
518</p>\r
519</dd>\r
520</dl>\r
521</div>\r
b484cbc8 522<h2><a id="viewer"></a>3. The Viewer</h2>\r
3ad8214b
JF
523<div class="sectionbody">\r
524<p>The display consists of a status window on the last line of the screen and one\r
525or more views. The default is to only show one view at the time but it is\r
526possible 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
528line, such as:</p>\r
b484cbc8 529<div class="listingblock">\r
3ad8214b
JF
530<div class="content">\r
531<pre><tt>commit 4d55caff4cc89335192f3e566004b4ceef572521</tt></pre>\r
532</div></div>\r
533<p>You will split the view so that the log view is displayed in the top window\r
534and the diff view in the bottom window. You can switch between the two views\r
535by pressing <em>Tab</em>. To maximize the log view again, simply press <em>l</em>.</p>\r
b484cbc8 536<h3><a id="commit-id"></a>3.1. Current Head and Commit ID</h3>\r
3ad8214b 537<p>The viewer keeps track of both what head and commit ID you are currently\r
af4c75a2 538viewing. The commit ID will follow the cursor line and change every time\r
3ad8214b
JF
539you highlight a different commit. Whenever you reopen the diff view it will be\r
540reloaded, 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
542revision to show history.</p>\r
b484cbc8
JF
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
3ad8214b
JF
545from an external command, most often <em>git log</em>, <em>git diff</em>, or <em>git show</em>.</p>\r
546<dl>\r
547<dt>\r
548The main view\r
549</dt>\r
550<dd>\r
551<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
556</p>\r
557</dd>\r
558<dt>\r
559The log view\r
560</dt>\r
561<dd>\r
562<p>\r
563 Presents a more rich view of the revision log showing the whole log\r
564 message and the diffstat.\r
565</p>\r
566</dd>\r
567<dt>\r
568The diff view\r
569</dt>\r
570<dd>\r
571<p>\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
575</p>\r
576</dd>\r
577<dt>\r
af4c75a2
JF
578The tree view\r
579</dt>\r
580<dd>\r
581<p>\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
584 viewed.\r
585</p>\r
586</dd>\r
587<dt>\r
588The blob view\r
589</dt>\r
590<dd>\r
591<p>\r
592 Displays the file content or "blob" of data associated with a file\r
593 name.\r
594</p>\r
595</dd>\r
596<dt>\r
3ad8214b
JF
597The pager view\r
598</dt>\r
599<dd>\r
600<p>\r
601 Is used for displaying both input from stdin and output from git\r
602 commands entered in the internal prompt.\r
603</p>\r
604</dd>\r
605<dt>\r
606The help view\r
607</dt>\r
608<dd>\r
609<p>\r
42afc55b 610 Displays key binding quick reference.\r
3ad8214b
JF
611</p>\r
612</dd>\r
613</dl>\r
b484cbc8 614<h3><a id="title-window"></a>3.3. Title Windows</h3>\r
3ad8214b
JF
615<p>Each view has a title window which shows the name of the view, current commit\r
616ID if available, and where the view is positioned:</p>\r
b484cbc8 617<div class="listingblock">\r
3ad8214b
JF
618<div class="content">\r
619<pre><tt>[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)</tt></pre>\r
620</div></div>\r
621<p>By default, the title of the current view is highlighted using bold font. For\r
622long loading views (taking over 3 seconds) the time since loading started will\r
623be appended:</p>\r
b484cbc8 624<div class="listingblock">\r
3ad8214b
JF
625<div class="content">\r
626<pre><tt>[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s</tt></pre>\r
627</div></div>\r
628</div>\r
c3a4b3e0 629<h2><a id="keys"></a>4. Default Keybindings</h2>\r
3ad8214b
JF
630<div class="sectionbody">\r
631<p>Below the default key bindings are shown.</p>\r
b484cbc8 632<h3><a id="view-switching"></a>4.1. View Switching</h3>\r
c3a4b3e0
JF
633<div class="tableblock">\r
634<table rules="none"\r
635frame="hsides"\r
636cellspacing="0" cellpadding="4">\r
637<col width="91" />\r
638<col width="788" />\r
639<thead>\r
640 <tr>\r
641 <th align="left">\r
642 Key\r
643 </th>\r
644 <th align="left">\r
645 Action\r
646 </th>\r
647 </tr>\r
648</thead>\r
649<tbody valign="top">\r
650 <tr>\r
651 <td align="left">\r
652 m\r
653 </td>\r
654 <td align="left">\r
655 Switch to main view.\r
656 </td>\r
657 </tr>\r
658 <tr>\r
659 <td align="left">\r
660 d\r
661 </td>\r
662 <td align="left">\r
663 Switch to diff view.\r
664 </td>\r
665 </tr>\r
666 <tr>\r
667 <td align="left">\r
668 l\r
669 </td>\r
670 <td align="left">\r
671 Switch to log view.\r
672 </td>\r
673 </tr>\r
674 <tr>\r
675 <td align="left">\r
676 p\r
677 </td>\r
678 <td align="left">\r
679 Switch to pager view.\r
680 </td>\r
681 </tr>\r
682 <tr>\r
683 <td align="left">\r
af4c75a2
JF
684 t\r
685 </td>\r
686 <td align="left">\r
687 Switch to (directory) tree view.\r
688 </td>\r
689 </tr>\r
690 <tr>\r
691 <td align="left">\r
692 f\r
693 </td>\r
694 <td align="left">\r
695 Switch to (file) blob view.\r
696 </td>\r
697 </tr>\r
698 <tr>\r
699 <td align="left">\r
700 h\r
c3a4b3e0
JF
701 </td>\r
702 <td align="left">\r
703 Show man page.\r
704 </td>\r
705 </tr>\r
706</tbody>\r
707</table>\r
708</div>\r
b484cbc8 709<h3><a id="view-manipulation"></a>4.2. View Manipulation</h3>\r
c3a4b3e0
JF
710<div class="tableblock">\r
711<table rules="none"\r
712frame="hsides"\r
713cellspacing="0" cellpadding="4">\r
714<col width="91" />\r
715<col width="788" />\r
716<thead>\r
717 <tr>\r
718 <th align="left">\r
719 Key\r
720 </th>\r
721 <th align="left">\r
722 Action\r
723 </th>\r
724 </tr>\r
725</thead>\r
726<tbody valign="top">\r
727 <tr>\r
728 <td align="left">\r
729 q\r
730 </td>\r
731 <td align="left">\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
733 </td>\r
734 </tr>\r
735 <tr>\r
736 <td align="left">\r
737 Enter\r
738 </td>\r
739 <td align="left">\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
741 </td>\r
742 </tr>\r
743 <tr>\r
744 <td align="left">\r
745 Tab\r
746 </td>\r
747 <td align="left">\r
748 Switch to next view.\r
749 </td>\r
750 </tr>\r
751 <tr>\r
752 <td align="left">\r
753 Up\r
754 </td>\r
755 <td align="left">\r
af4c75a2 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
c3a4b3e0
JF
757 </td>\r
758 </tr>\r
759 <tr>\r
760 <td align="left">\r
761 Down\r
762 </td>\r
763 <td align="left">\r
764 Similar to <em>Up</em> but will move down.\r
765 </td>\r
766 </tr>\r
767</tbody>\r
768</table>\r
769</div>\r
b484cbc8 770<h3><a id="cursor-nav"></a>4.3. Cursor Navigation</h3>\r
c3a4b3e0
JF
771<div class="tableblock">\r
772<table rules="none"\r
773frame="hsides"\r
774cellspacing="0" cellpadding="4">\r
775<col width="91" />\r
776<col width="788" />\r
777<thead>\r
778 <tr>\r
779 <th align="left">\r
780 Key\r
781 </th>\r
782 <th align="left">\r
783 Action\r
784 </th>\r
785 </tr>\r
786</thead>\r
787<tbody valign="top">\r
788 <tr>\r
789 <td align="left">\r
790 j\r
791 </td>\r
792 <td align="left">\r
793 Move cursor one line up.\r
794 </td>\r
795 </tr>\r
796 <tr>\r
797 <td align="left">\r
798 k\r
799 </td>\r
800 <td align="left">\r
801 Move cursor one line down.\r
802 </td>\r
803 </tr>\r
804 <tr>\r
805 <td align="left">\r
5c09dc14 806 PgUp,-,a\r
c3a4b3e0
JF
807 </td>\r
808 <td align="left">\r
809 Move cursor one page up.\r
810 </td>\r
811 </tr>\r
812 <tr>\r
813 <td align="left">\r
814 PgDown\r
815 </td>\r
816 <td align="left">\r
817 Space Move cursor one page down.\r
818 </td>\r
819 </tr>\r
820 <tr>\r
821 <td align="left">\r
822 Home\r
823 </td>\r
824 <td align="left">\r
825 Jump to first line.\r
826 </td>\r
827 </tr>\r
828 <tr>\r
829 <td align="left">\r
830 End\r
831 </td>\r
832 <td align="left">\r
833 Jump to last line.\r
834 </td>\r
835 </tr>\r
836</tbody>\r
837</table>\r
838</div>\r
b484cbc8 839<h3><a id="view-scrolling"></a>4.4. Scrolling</h3>\r
c3a4b3e0
JF
840<div class="tableblock">\r
841<table rules="none"\r
842frame="hsides"\r
843cellspacing="0" cellpadding="4">\r
844<col width="91" />\r
845<col width="788" />\r
846<thead>\r
847 <tr>\r
848 <th align="left">\r
849 Key\r
850 </th>\r
851 <th align="left">\r
852 Action\r
853 </th>\r
854 </tr>\r
855</thead>\r
856<tbody valign="top">\r
857 <tr>\r
858 <td align="left">\r
859 Insert\r
860 </td>\r
861 <td align="left">\r
862 Scroll view one line up.\r
863 </td>\r
864 </tr>\r
865 <tr>\r
866 <td align="left">\r
867 Delete\r
868 </td>\r
869 <td align="left">\r
870 Scroll view one line down.\r
871 </td>\r
872 </tr>\r
873 <tr>\r
874 <td align="left">\r
875 w\r
876 </td>\r
877 <td align="left">\r
878 Scroll view one page up.\r
879 </td>\r
880 </tr>\r
881 <tr>\r
882 <td align="left">\r
883 s\r
884 </td>\r
885 <td align="left">\r
886 Scroll view one page down.\r
887 </td>\r
888 </tr>\r
889</tbody>\r
890</table>\r
891</div>\r
af4c75a2
JF
892<h3><a id="searching"></a>4.5. Searching</h3>\r
893<div class="tableblock">\r
894<table rules="none"\r
895frame="hsides"\r
896cellspacing="0" cellpadding="4">\r
897<col width="91" />\r
898<col width="788" />\r
899<thead>\r
900 <tr>\r
901 <th align="left">\r
902 Key\r
903 </th>\r
904 <th align="left">\r
905 Action\r
906 </th>\r
907 </tr>\r
908</thead>\r
909<tbody valign="top">\r
910 <tr>\r
911 <td align="left">\r
912 /\r
913 </td>\r
914 <td align="left">\r
915 Search the view. Opens a prompt for entering search regex to use.\r
916 </td>\r
917 </tr>\r
918 <tr>\r
919 <td align="left">\r
920 ?\r
921 </td>\r
922 <td align="left">\r
923 Search backwards in the view. Also prompts for regex.\r
924 </td>\r
925 </tr>\r
926 <tr>\r
927 <td align="left">\r
928 n\r
929 </td>\r
930 <td align="left">\r
931 Find next match for the current search regex.\r
932 </td>\r
933 </tr>\r
934 <tr>\r
935 <td align="left">\r
936 N\r
937 </td>\r
938 <td align="left">\r
939 Find previous match for the current search regex.\r
940 </td>\r
941 </tr>\r
942</tbody>\r
943</table>\r
944</div>\r
945<h3><a id="misc-keys"></a>4.6. Misc</h3>\r
c3a4b3e0
JF
946<div class="tableblock">\r
947<table rules="none"\r
948frame="hsides"\r
949cellspacing="0" cellpadding="4">\r
950<col width="91" />\r
951<col width="788" />\r
952<thead>\r
953 <tr>\r
954 <th align="left">\r
955 Key\r
956 </th>\r
957 <th align="left">\r
958 Action\r
959 </th>\r
960 </tr>\r
961</thead>\r
962<tbody valign="top">\r
963 <tr>\r
964 <td align="left">\r
965 Q\r
966 </td>\r
967 <td align="left">\r
968 Quit.\r
969 </td>\r
970 </tr>\r
971 <tr>\r
972 <td align="left">\r
973 r\r
974 </td>\r
975 <td align="left">\r
976 Redraw screen.\r
977 </td>\r
978 </tr>\r
979 <tr>\r
980 <td align="left">\r
981 z\r
982 </td>\r
983 <td align="left">\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
985 </td>\r
986 </tr>\r
987 <tr>\r
988 <td align="left">\r
989 v\r
990 </td>\r
991 <td align="left">\r
992 Show version.\r
993 </td>\r
994 </tr>\r
995 <tr>\r
996 <td align="left">\r
af4c75a2 997 <em>.</em>\r
c3a4b3e0
JF
998 </td>\r
999 <td align="left">\r
1000 Toggle line numbers on/off.\r
1001 </td>\r
1002 </tr>\r
1003 <tr>\r
1004 <td align="left">\r
1005 g\r
1006 </td>\r
1007 <td align="left">\r
1008 Toggle revision graph visualization on/off.\r
1009 </td>\r
1010 </tr>\r
1011 <tr>\r
1012 <td align="left">\r
1013 <em>:</em>\r
1014 </td>\r
1015 <td align="left">\r
1016 Open prompt. This allows you to specify what git command to run. Example <tt>:log -p</tt>\r
1017 </td>\r
1018 </tr>\r
1019</tbody>\r
1020</table>\r
1021</div>\r
3ad8214b 1022</div>\r
b484cbc8 1023<h2><a id="refspec"></a>5. Revision Specification</h2>\r
3ad8214b
JF
1024<div class="sectionbody">\r
1025<p>This section describes various ways to specify what revisions to display or\r
b484cbc8 1026otherwise limit the view to. Tig does not itself parse the described\r
af4c75a2 1027revision options so refer to the relevant git man pages for further\r
3ad8214b
JF
1028information. Relevant man pages besides git-log(1) are git-diff(1) and\r
1029git-rev-list(1).</p>\r
1030<p>You can tune the interaction with git by making use of the options explained\r
1031in this section. For example, by configuring the environment variables\r
1032described in the <a href="#history-commands">"History commands"</a> section.</p>\r
b484cbc8 1033<h3><a id="path-limiting"></a>5.1. Limit by Path Name</h3>\r
3ad8214b
JF
1034<p>If you are interested only in those revisions that made changes to a specific\r
1035file (or even several files) list the files like this:</p>\r
b484cbc8 1036<div class="listingblock">\r
3ad8214b
JF
1037<div class="content">\r
1038<pre><tt>$ tig log Makefile README</tt></pre>\r
1039</div></div>\r
1040<p>To avoid ambiguity with repository references such as tag name, be sure to\r
1041separate file names from other git options using "--". So if you have a file\r
1042named <em>master</em> it will clash with the reference named <em>master</em>, and thus you\r
1043will have to use:</p>\r
b484cbc8 1044<div class="listingblock">\r
3ad8214b
JF
1045<div class="content">\r
1046<pre><tt>$ tig log -- master</tt></pre>\r
1047</div></div>\r
1048<div class="admonitionblock">\r
1049<table><tr>\r
1050<td class="icon">\r
1051<div class="title">Note</div>\r
1052</td>\r
1053<td class="content">For the main view, avoiding ambiguity will in some cases require you to\r
b484cbc8 1054specify two "--" options. The first will make tig stop option processing\r
3ad8214b
JF
1055and the latter will be passed to git log.</td>\r
1056</tr></table>\r
1057</div>\r
b484cbc8 1058<h3><a id="date-number-limiting"></a>5.2. Limit by Date or Number</h3>\r
3ad8214b
JF
1059<p>To speed up interaction with git, you can limit the amount of commits to show\r
1060both for the log and main view. Either limit by date using e.g.\r
1061<tt>&#8212;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
1063use:</p>\r
b484cbc8 1064<div class="listingblock">\r
3ad8214b
JF
1065<div class="content">\r
1066<pre><tt>$ tig -- --after="May 5th" --before="2006-05-16 15:44"</tt></pre>\r
1067</div></div>\r
1068<div class="admonitionblock">\r
1069<table><tr>\r
1070<td class="icon">\r
1071<div class="title">Note</div>\r
1072</td>\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>&#8212;after=May.5th</tt>.</td>\r
1075</tr></table>\r
1076</div>\r
b484cbc8 1077<h3><a id="commit-range-limiting"></a>5.3. Limiting by Commit Ranges</h3>\r
3ad8214b
JF
1078<p>Alternatively, commits can be limited to a specific range, such as "all\r
1079commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:</p>\r
b484cbc8 1080<div class="listingblock">\r
3ad8214b
JF
1081<div class="content">\r
1082<pre><tt>$ tig log tag-1.0..tag-2.0</tt></pre>\r
1083</div></div>\r
1084<p>This way of commit limiting makes it trivial to only browse the commits which\r
1085haven't been pushed to a remote branch. Assuming <em>origin</em> is your upstream\r
1086remote branch, using:</p>\r
b484cbc8 1087<div class="listingblock">\r
3ad8214b
JF
1088<div class="content">\r
1089<pre><tt>$ tig log origin..HEAD</tt></pre>\r
1090</div></div>\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
b484cbc8 1093<h3><a id="reachability-limiting"></a>5.4. Limiting by Reachability</h3>\r
3ad8214b
JF
1094<p>Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits\r
1095reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>". Where reachability refers\r
1096to what commits are ancestors (or part of the history) of the branch or tagged\r
1097revision in question.</p>\r
1098<p>If you prefer to specify which commit to preview in this way use the\r
1099following:</p>\r
b484cbc8 1100<div class="listingblock">\r
3ad8214b
JF
1101<div class="content">\r
1102<pre><tt>$ tig log tag-2.0 ^tag-1.0</tt></pre>\r
1103</div></div>\r
1104<p>You can think of <em>^</em> as a negation operator. Using this alternate syntax, it\r
1105is possible to further prune commits by specifying multiple branch cut offs.</p>\r
b484cbc8 1106<h3><a id="refspec-combi"></a>5.5. Combining Revisions Specification</h3>\r
3ad8214b
JF
1107<p>Revisions options can to some degree be combined, which makes it possible to\r
1108say "show at most 20 commits from within the last month that changed files\r
1109under the Documentation/ directory."</p>\r
b484cbc8 1110<div class="listingblock">\r
3ad8214b
JF
1111<div class="content">\r
1112<pre><tt>$ tig -- --since=1.month -n20 -- Documentation/</tt></pre>\r
1113</div></div>\r
b484cbc8 1114<h3><a id="refspec-all"></a>5.6. Examining All Repository References</h3>\r
3ad8214b
JF
1115<p>In some cases, it can be useful to query changes across all references in a\r
1116repository. An example is to ask "did any line of development in this\r
1117repository change a particular file within the last week". This can be\r
1118accomplished using:</p>\r
b484cbc8 1119<div class="listingblock">\r
3ad8214b
JF
1120<div class="content">\r
1121<pre><tt>$ tig -- --all --since=1.week -- Makefile</tt></pre>\r
1122</div></div>\r
1123</div>\r
b484cbc8 1124<h2>6. BUGS</h2>\r
3ad8214b
JF
1125<div class="sectionbody">\r
1126<p>Known bugs and problems:</p>\r
1127<ul>\r
1128<li>\r
1129<p>\r
af4c75a2 1130Proper locale support: in it's current state tig is pretty much UTF-8 only.\r
3ad8214b
JF
1131</p>\r
1132</li>\r
1133<li>\r
1134<p>\r
af4c75a2 1135Horizontal scrolling.\r
3ad8214b
JF
1136</p>\r
1137</li>\r
3ad8214b
JF
1138</ul>\r
1139</div>\r
b484cbc8 1140<h2><a id="copy-right"></a>7. Copyright</h2>\r
3ad8214b
JF
1141<div class="sectionbody">\r
1142<p>Copyright (c) 2006 Jonas Fonseca &lt;fonseca@diku.dk&gt;</p>\r
1143<p>This program is free software; you can redistribute it and/or modify\r
1144it under the terms of the GNU General Public License as published by\r
1145the Free Software Foundation; either version 2 of the License, or\r
1146(at your option) any later version.</p>\r
1147</div>\r
b484cbc8 1148<h2><a id="references"></a>8. References and Related Tools</h2>\r
3ad8214b 1149<div class="sectionbody">\r
b484cbc8
JF
1150<p>Manpages:</p>\r
1151<ul>\r
1152<li>\r
1153<p>\r
1154<a href="tig.1.html">tig(1)</a>\r
1155</p>\r
1156</li>\r
1157<li>\r
1158<p>\r
1159<a href="tigrc.5.html">tigrc(5)</a>\r
1160</p>\r
1161</li>\r
1162</ul>\r
1163<p>Online resources:</p>\r
3ad8214b
JF
1164<ul>\r
1165<li>\r
1166<p>\r
1167Homepage: <a href="http://jonas.nitro.dk/tig">http://jonas.nitro.dk/tig</a>\r
1168</p>\r
1169</li>\r
1170<li>\r
1171<p>\r
5c09dc14
JF
1172Manual: <a href="http://jonas.nitro.dk/tig/manual.html">http://jonas.nitro.dk/tig/manual.html</a>\r
1173</p>\r
1174</li>\r
1175<li>\r
1176<p>\r
3ad8214b
JF
1177Releases: <a href="http://jonas.nitro.dk/tig/releases">http://jonas.nitro.dk/tig/releases</a>\r
1178</p>\r
1179</li>\r
1180<li>\r
1181<p>\r
1182Git URL: <a href="http://jonas.nitro.dk/tig/tig.git">http://jonas.nitro.dk/tig/tig.git</a>\r
1183</p>\r
1184</li>\r
1185<li>\r
1186<p>\r
1187Gitweb: <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
1188</p>\r
1189</li>\r
1190</ul>\r
1191<p>Git porcelains:</p>\r
1192<ul>\r
1193<li>\r
1194<p>\r
1195<a href="http://www.kernel.org/pub/software/scm/git/docs/">git</a>,\r
1196</p>\r
1197</li>\r
1198<li>\r
1199<p>\r
1200<a href="http://www.kernel.org/pub/software/scm/cogito/docs/">Cogito</a>\r
1201</p>\r
1202</li>\r
1203</ul>\r
1204<p>Other git repository browsers:</p>\r
1205<ul>\r
1206<li>\r
1207<p>\r
1208gitk(1)\r
1209</p>\r
1210</li>\r
1211<li>\r
1212<p>\r
1213qgit(1)\r
1214</p>\r
1215</li>\r
1216<li>\r
1217<p>\r
1218gitview(1)\r
1219</p>\r
1220</li>\r
1221</ul>\r
1222</div>\r
1223<div id="footer">\r
1224<div id="footer-text">\r
af4c75a2 1225Last updated 18-Sep-2006 18:23:56 CEST\r
3ad8214b
JF
1226</div>\r
1227</div>\r
1228</body>\r
1229</html>\r