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