
| Current Path : /usr/share/doc/tig/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //usr/share/doc/tig/manual.html |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 9.0.0rc1" />
<title>The Tig Manual</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
/* Default font. */
body {
font-family: Georgia,serif;
}
/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
font-family: Arial,Helvetica,sans-serif;
}
body {
margin: 1em 5% 1em 5%;
}
a {
color: blue;
text-decoration: underline;
}
a:visited {
color: fuchsia;
}
em {
font-style: italic;
color: navy;
}
strong {
font-weight: bold;
color: #083194;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
margin-top: 1.2em;
margin-bottom: 0.5em;
line-height: 1.3;
}
h1, h2, h3 {
border-bottom: 2px solid silver;
}
h2 {
padding-top: 0.5em;
}
h3 {
float: left;
}
h3 + * {
clear: left;
}
h5 {
font-size: 1.0em;
}
div.sectionbody {
margin-left: 0;
}
hr {
border: 1px solid silver;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
ul, ol, li > p {
margin-top: 0;
}
ul > li { color: #aaa; }
ul > li > * { color: black; }
.monospaced, code, pre {
font-family: "Courier New", Courier, monospace;
font-size: inherit;
color: navy;
padding: 0;
margin: 0;
}
pre {
white-space: pre-wrap;
}
#author {
color: #527bbd;
font-weight: bold;
font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}
#footer {
font-size: small;
border-top: 2px solid silver;
padding-top: 0.5em;
margin-top: 4.0em;
}
#footer-text {
float: left;
padding-bottom: 0.5em;
}
#footer-badges {
float: right;
padding-bottom: 0.5em;
}
#preamble {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.0em;
margin-bottom: 2.0em;
margin-right: 10%;
color: #606060;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
color: #527bbd;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid #dddddd;
border-left: 4px solid #f0f0f0;
padding: 0.5em;
}
div.listingblock > div.content {
border: 1px solid #dddddd;
border-left: 5px solid #f0f0f0;
background: #f8f8f8;
padding: 0.5em;
}
div.quoteblock, div.verseblock {
padding-left: 1.0em;
margin-left: 1.0em;
margin-right: 10%;
border-left: 5px solid #f0f0f0;
color: #888;
}
div.quoteblock > div.attribution {
padding-top: 0.5em;
text-align: right;
}
div.verseblock > pre.content {
font-family: inherit;
font-size: inherit;
}
div.verseblock > div.attribution {
padding-top: 0.75em;
text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
text-align: left;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #527bbd;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 3px solid #dddddd;
}
div.exampleblock > div.content {
border-left: 3px solid #dddddd;
padding-left: 0.5em;
}
div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: normal;
color: navy;
}
dd > *:first-child {
margin-top: 0.1em;
}
ul, ol {
list-style-position: outside;
}
ol.arabic {
list-style-type: decimal;
}
ol.loweralpha {
list-style-type: lower-alpha;
}
ol.upperalpha {
list-style-type: upper-alpha;
}
ol.lowerroman {
list-style-type: lower-roman;
}
ol.upperroman {
list-style-type: upper-roman;
}
div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
margin-top: 0.1em;
margin-bottom: 0.1em;
}
tfoot {
font-weight: bold;
}
td > div.verse {
white-space: pre;
}
div.hdlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
div.hdlist tr {
padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
font-weight: bold;
}
td.hdlist1 {
vertical-align: top;
font-style: normal;
padding-right: 0.8em;
color: navy;
}
td.hdlist2 {
vertical-align: top;
}
div.hdlist.compact tr {
margin: 0;
padding-bottom: 0;
}
.comment {
background: yellow;
}
.footnote, .footnoteref {
font-size: 0.8em;
}
span.footnote, span.footnoteref {
vertical-align: super;
}
#footnotes {
margin: 20px 0 20px 0;
padding: 7px 0 0 0;
}
#footnotes div.footnote {
margin: 0 0 5px 0;
}
#footnotes hr {
border: none;
border-top: 1px solid silver;
height: 1px;
text-align: left;
margin-left: 0;
width: 20%;
min-width: 100px;
}
div.colist td {
padding-right: 0.5em;
padding-bottom: 0.3em;
vertical-align: top;
}
div.colist td img {
margin-top: 0.3em;
}
@media print {
#footer-badges { display: none; }
}
#toc {
margin-bottom: 2.5em;
}
#toctitle {
color: #527bbd;
font-size: 1.1em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 0.1em;
}
div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
div.toclevel2 {
margin-left: 2em;
font-size: 0.9em;
}
div.toclevel3 {
margin-left: 4em;
font-size: 0.9em;
}
div.toclevel4 {
margin-left: 6em;
font-size: 0.9em;
}
span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }
span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }
span.big { font-size: 2em; }
span.small { font-size: 0.6em; }
span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
div.unbreakable { page-break-inside: avoid; }
/*
* xhtml11 specific
*
* */
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
div.tableblock > table {
border: 3px solid #527bbd;
}
thead, p.table.header {
font-weight: bold;
color: #527bbd;
}
p.table {
margin-top: 0;
}
/* Because the table frame attribute is overridden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
border-style: none;
}
div.tableblock > table[frame="hsides"] {
border-left-style: none;
border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
border-top-style: none;
border-bottom-style: none;
}
/*
* html5 specific
*
* */
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
thead, p.tableblock.header {
font-weight: bold;
color: #527bbd;
}
p.tableblock {
margin-top: 0;
}
table.tableblock {
border-width: 3px;
border-spacing: 0px;
border-style: solid;
border-color: #527bbd;
border-collapse: collapse;
}
th.tableblock, td.tableblock {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #527bbd;
}
table.tableblock.frame-topbot {
border-left-style: hidden;
border-right-style: hidden;
}
table.tableblock.frame-sides {
border-top-style: hidden;
border-bottom-style: hidden;
}
table.tableblock.frame-none {
border-style: hidden;
}
th.tableblock.halign-left, td.tableblock.halign-left {
text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
text-align: right;
}
th.tableblock.valign-top, td.tableblock.valign-top {
vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
vertical-align: bottom;
}
/*
* manpage specific
*
* */
body.manpage h1 {
padding-top: 0.5em;
padding-bottom: 0.5em;
border-top: 2px solid silver;
border-bottom: 2px solid silver;
}
body.manpage h2 {
border-style: none;
}
body.manpage div.sectionbody {
margin-left: 3em;
}
@media print {
body.manpage div#toc { display: none; }
}
</style>
<script type="text/javascript">
/*<+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
var iterate = function (el) {
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
var mo = re.exec(i.tagName);
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
}
iterate(i);
}
}
}
iterate(el);
return result;
}
var toc = document.getElementById("toc");
if (!toc) {
return;
}
// Delete existing TOC entries in case we're reloading the TOC.
var tocEntriesToRemove = [];
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
}
for (i = 0; i < tocEntriesToRemove.length; i++) {
toc.removeChild(tocEntriesToRemove[i]);
}
// Rebuild TOC entries.
var entries = tocEntries(document.getElementById("content"), toclevels);
for (var i = 0; i < entries.length; ++i) {
var entry = entries[i];
if (entry.element.id == "")
entry.element.id = "_toc_" + i;
var a = document.createElement("a");
a.href = "#" + entry.element.id;
a.appendChild(document.createTextNode(entry.text));
var div = document.createElement("div");
div.appendChild(a);
div.className = "toclevel" + entry.toclevel;
toc.appendChild(div);
}
if (entries.length == 0)
toc.parentNode.removeChild(toc);
},
/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////
/* Based on footnote generation code from:
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
*/
footnotes: function () {
// Delete existing footnote entries in case we're reloading the footnodes.
var i;
var noteholder = document.getElementById("footnotes");
if (!noteholder) {
return;
}
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
noteholder.removeChild(entriesToRemove[i]);
}
// Rebuild footnote entries.
var cont = document.getElementById("content");
var spans = cont.getElementsByTagName("span");
var refs = {};
var n = 0;
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnote") {
n++;
var note = spans[i].getAttribute("data-note");
if (!note) {
// Use [\s\S] in place of . so multi-line matches work.
// Because JavaScript has no s (dotall) regex flag.
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
spans[i].innerHTML =
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
spans[i].setAttribute("data-note", note);
}
noteholder.innerHTML +=
"<div class='footnote' id='_footnote_" + n + "'>" +
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
n + "</a>. " + note + "</div>";
var id =spans[i].getAttribute("id");
if (id != null) refs["#"+id] = n;
}
}
if (n == 0)
noteholder.parentNode.removeChild(noteholder);
else {
// Process footnoterefs.
for (i=0; i<spans.length; i++) {
if (spans[i].className == "footnoteref") {
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
href = href.match(/#.*/)[0]; // Because IE return full URL.
n = refs[href];
spans[i].innerHTML =
"[<a href='#_footnote_" + n +
"' title='View footnote' class='footnote'>" + n + "</a>]";
}
}
}
},
install: function(toclevels) {
var timerId;
function reinstall() {
asciidoc.footnotes();
if (toclevels) {
asciidoc.toc(toclevels);
}
}
function reinstallAndRemoveTimer() {
clearInterval(timerId);
reinstall();
}
timerId = setInterval(reinstall, 500);
if (document.addEventListener)
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
else
window.onload = reinstallAndRemoveTimer;
}
}
asciidoc.install();
/*]]>*/
</script>
</head>
<body class="article">
<div id="header">
<h1>The Tig Manual</h1>
<span id="author">Jonas Fonseca</span><br />
<span id="email"><code><<a href="mailto:jonas.fonseca@gmail.com">jonas.fonseca@gmail.com</a>></code></span><br />
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>This is the manual for Tig, the ncurses-based text-mode interface for git.
Tig allows you to browse changes in a Git repository and can additionally act
as a pager for output of various Git commands. When used as a pager, it will
display input from stdin and colorize it.</p></div>
<div class="paragraph"><p>When browsing repositories, Tig uses the underlying Git commands to present
the user with various views, such as summarized commit log and showing the
commit with the log message, diffstat, and the diff.</p></div>
<div class="paragraph"><p><strong>Table of Contents</strong></p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
<a href="#calling-conventions">Calling Conventions</a>
</p>
<div class="ulist"><ul>
<li>
<p>
<a href="#pager-mode">Pager Mode</a>
</p>
</li>
<li>
<p>
<a href="#cmd-options">Git Command Options</a>
</p>
</li>
</ul></div>
</li>
<li>
<p>
<a href="#viewer">The Viewer</a>
</p>
<div class="ulist"><ul>
<li>
<p>
<a href="#views">Views</a>
</p>
</li>
<li>
<p>
<a href="#commit-id">Browsing State and User-defined Commands</a>
</p>
</li>
<li>
<p>
<a href="#title-window">Title Windows</a>
</p>
</li>
</ul></div>
</li>
<li>
<p>
<a href="#env-variables">Environment Variables</a>
</p>
<div class="ulist"><ul>
<li>
<p>
<a href="#configuration-files">Configuration Files</a>
</p>
</li>
<li>
<p>
<a href="#history-files">History Files</a>
</p>
</li>
<li>
<p>
<a href="#repo-refs">Repository References</a>
</p>
</li>
<li>
<p>
<a href="#diff-options">Diff options</a>
</p>
</li>
</ul></div>
</li>
<li>
<p>
<a href="#keys">Default Keybindings</a>
</p>
<div class="ulist"><ul>
<li>
<p>
<a href="#view-switching">View Switching</a>
</p>
</li>
<li>
<p>
<a href="#view-manipulation">View Manipulation</a>
</p>
</li>
<li>
<p>
<a href="#view-actions">View Specific Actions</a>
</p>
</li>
<li>
<p>
<a href="#cursor-nav">Cursor Navigation</a>
</p>
</li>
<li>
<p>
<a href="#view-scrolling">Scrolling</a>
</p>
</li>
<li>
<p>
<a href="#searching">Searching</a>
</p>
</li>
<li>
<p>
<a href="#misc-keys">Misc</a>
</p>
</li>
<li>
<p>
<a href="#prompt">Prompt</a>
</p>
</li>
<li>
<p>
<a href="#external-commands">External Commands</a>
</p>
</li>
</ul></div>
</li>
<li>
<p>
<a href="#refspec">Revision Specification</a>
</p>
<div class="ulist"><ul>
<li>
<p>
<a href="#path-limiting">Limit by Path Name</a>
</p>
</li>
<li>
<p>
<a href="#date-number-limiting">Limit by Date or Number</a>
</p>
</li>
<li>
<p>
<a href="#commit-range-limiting">Limiting by Commit Ranges</a>
</p>
</li>
<li>
<p>
<a href="#reachability-limiting">Limiting by Reachability</a>
</p>
</li>
<li>
<p>
<a href="#refspec-combi">Combining Revisions Specification</a>
</p>
</li>
<li>
<p>
<a href="#refspec-all">Examining All Repository References</a>
</p>
</li>
</ul></div>
</li>
<li>
<p>
<a href="#copy-right">Copyright</a>
</p>
</li>
<li>
<p>
<a href="#references">See Also</a>
</p>
</li>
</ol></div>
</div>
</div>
<div class="sect1">
<h2 id="calling-conventions">1. Calling Conventions</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="pager-mode">1.1. Pager Mode</h3>
<div class="paragraph"><p>If stdin is a pipe, any log or diff options will be ignored and the pager view
will be opened loading data from stdin. The pager mode can be used for
colorizing output from various Git commands.</p></div>
<div class="paragraph"><p>Example on how to colorize the output of git-show(1):</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git show | tig</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="cmd-options">1.2. Git Command Options</h3>
<div class="paragraph"><p>All Git command options specified on the command line will be passed to the
given command and all will be shell quoted before they are passed to the
shell.</p></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">If you specify options for the main view, you should not use the
<code>--pretty</code> option as this option will be set automatically to the format
expected by the main view.</td>
</tr></table>
</div>
<div class="paragraph"><p>Example on how to view a commit and show both author and committer
information:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig show --pretty=fuller</code></pre>
</div></div>
<div class="paragraph"><p>See the section on <a href="#refspec">specifying revisions</a> for an introduction to
revision options supported by the Git commands. For details on specific Git
command options, refer to the man page of the command in question.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="viewer">2. The Viewer</h2>
<div class="sectionbody">
<div class="paragraph"><p>The display consists of a status window on the last line of the screen and one
or more views. The default is to only show one view at a time but it is
possible to split both the main and log view to also show the commit diff.</p></div>
<div class="paragraph"><p>If you are in the log view and press <em>Enter</em> when the current line is a commit
line, such as:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>commit 4d55caff4cc89335192f3e566004b4ceef572521</code></pre>
</div></div>
<div class="paragraph"><p>You will split the view so that the log view is displayed in the top window
and the diff view in the bottom window. You can switch between the two views
by pressing <em>Tab</em>. To maximize the log view again, simply press <em>l</em>.</p></div>
<div class="sect2">
<h3 id="views">2.1. Views</h3>
<div class="paragraph"><p>Various <em>views</em> of a repository are presented. Each view is based on output
from an external command, most often <em>git log</em>, <em>git diff</em>, or <em>git show</em>.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
The main view
</dt>
<dd>
<p>
Is the default view, and it shows a one line summary of each commit
in the chosen list of revisions. The summary includes author date,
author, and the first line of the log message. Additionally, any
repository references, such as tags, will be shown.
</p>
</dd>
<dt class="hdlist1">
The log view
</dt>
<dd>
<p>
Presents a more rich view of the revision log showing the whole log
message and the diffstat.
</p>
</dd>
<dt class="hdlist1">
The diff view
</dt>
<dd>
<p>
Shows either the diff of the current working tree, that is, what
has changed since the last commit, or the commit diff complete
with log message, diffstat and diff.
</p>
</dd>
<dt class="hdlist1">
The tree view
</dt>
<dd>
<p>
Lists directory trees associated with the current revision allowing
subdirectories to be descended or ascended and file blobs to be
viewed.
</p>
</dd>
<dt class="hdlist1">
The blob view
</dt>
<dd>
<p>
Displays the file content or "blob" of data associated with a file
name.
</p>
</dd>
<dt class="hdlist1">
The blame view
</dt>
<dd>
<p>
Displays the file content annotated or blamed by commits.
</p>
</dd>
<dt class="hdlist1">
The refs view
</dt>
<dd>
<p>
Displays the branches, remotes and tags in the repository.
</p>
</dd>
<dt class="hdlist1">
The status view
</dt>
<dd>
<p>
Displays status of files in the working tree and allows changes to be
staged/unstaged as well as adding of untracked files.
</p>
</dd>
<dt class="hdlist1">
The stage view
</dt>
<dd>
<p>
Displays diff changes for staged or unstaged files being tracked or
file content of untracked files.
</p>
</dd>
<dt class="hdlist1">
The stash view
</dt>
<dd>
<p>
Displays the list of stashes in the repository.
</p>
</dd>
<dt class="hdlist1">
The grep view
</dt>
<dd>
<p>
Displays a list of files and all the lines that matches a search
pattern.
</p>
</dd>
<dt class="hdlist1">
The pager view
</dt>
<dd>
<p>
Is used for displaying both input from stdin and output from Git
commands entered in the internal prompt.
</p>
</dd>
<dt class="hdlist1">
The help view
</dt>
<dd>
<p>
Displays a quick reference of key bindings.
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="commit-id">2.2. Browsing State and User-defined Commands</h3>
<div class="paragraph"><p>The viewer keeps track of both what head and commit ID you are currently
viewing. The commit ID will follow the cursor line and change every time you
highlight a different commit. Whenever you reopen the diff view it will be
reloaded, if the commit ID changed. The head ID is used when opening the main
and log view to indicate from what revision to show history.</p></div>
<div class="paragraph"><p>Some of the commands used or provided by Tig can be configured. This goes for
some of the <a href="#env-variables">environment variables</a> as well as the
<a href="#external-commands">external commands</a>. These user-defined commands can use
arguments that refer to the current browsing state by using one of the
following variables.</p></div>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<caption class="title">Table 1. Browsing state variables</caption>
<col width="25%" />
<col width="75%" />
<tbody>
<tr>
<td align="left" valign="top"><p class="table"><code>%(head)</code></p></td>
<td align="left" valign="top"><p class="table">The currently viewed <em>head</em> ID. Defaults to HEAD</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(commit)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected commit ID.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(blob)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected blob ID.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(branch)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected branch name.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(remote)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected remote name. For remote
branches %(branch) will contain the branch name.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(tag)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected tag name.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(stash)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected stash name.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(directory)</code></p></td>
<td align="left" valign="top"><p class="table">The current directory path in the tree view or
"." if undefined.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(file)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected file.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(lineno)</code></p></td>
<td align="left" valign="top"><p class="table">The currently selected line number. Defaults to 0.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(ref)</code></p></td>
<td align="left" valign="top"><p class="table">The reference given to blame or HEAD if undefined.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(revargs)</code></p></td>
<td align="left" valign="top"><p class="table">The revision arguments passed on the command line.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(fileargs)</code></p></td>
<td align="left" valign="top"><p class="table">The file arguments passed on the command line.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(cmdlineargs)</code></p></td>
<td align="left" valign="top"><p class="table">All other options passed on the command line.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(diffargs)</code></p></td>
<td align="left" valign="top"><p class="table">Options from <em>diff-options</em> or <em>TIG_DIFF_OPTS</em> used
by the diff and stage view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(blameargs)</code></p></td>
<td align="left" valign="top"><p class="table">Options from <em>blame-options</em> used by the blame view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(logargs)</code></p></td>
<td align="left" valign="top"><p class="table">Options from <em>log-options</em> used by the log view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(mainargs)</code></p></td>
<td align="left" valign="top"><p class="table">Options from <em>main-options</em> used by the main view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(prompt)</code></p></td>
<td align="left" valign="top"><p class="table">Prompt for the argument value. Optionally specify a
custom prompt using <code>"%(prompt Enter branch name: )"</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(text)</code></p></td>
<td align="left" valign="top"><p class="table">The text of the currently selected line.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:head)</code></p></td>
<td align="left" valign="top"><p class="table">The name of the checked out branch, e.g. <code>master</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:head-id)</code></p></td>
<td align="left" valign="top"><p class="table">The commit ID of the checked out branch.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:remote)</code></p></td>
<td align="left" valign="top"><p class="table">The remote associated with the checked out branch,
e.g. <code>origin/master</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:cdup)</code></p></td>
<td align="left" valign="top"><p class="table">The path to change directory to the repository root,
e.g. <code>../</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:prefix)</code></p></td>
<td align="left" valign="top"><p class="table">The path prefix of the current work directory,
e.g <code>subdir/</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:git-dir)</code></p></td>
<td align="left" valign="top"><p class="table">The path to the Git directory, e.g. <code>/src/repo/.git</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:worktree)</code></p></td>
<td align="left" valign="top"><p class="table">The worktree path, if defined.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><code>%(repo:is-inside-work-tree)</code></p></td>
<td align="left" valign="top"><p class="table">Whether Tig is running inside a work tree,
either <code>true</code> or <code>false</code>.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="paragraph"><p>Example user-defined commands:</p></div>
<div class="ulist"><ul>
<li>
<p>
Allow to amend the last commit:
</p>
<div class="literalblock">
<div class="content">
<pre><code>bind generic + !git commit --amend</code></pre>
</div></div>
</li>
<li>
<p>
Copy commit ID to clipboard:
</p>
<div class="literalblock">
<div class="content">
<pre><code>bind generic 9 !@sh -c "echo -n %(commit) | xclip -selection c"</code></pre>
</div></div>
</li>
<li>
<p>
Add/edit notes for the current commit used during a review:
</p>
<div class="literalblock">
<div class="content">
<pre><code>bind generic T !git notes edit %(commit)</code></pre>
</div></div>
</li>
<li>
<p>
Enter Git’s interactive add for fine-grained staging of file content:
</p>
<div class="literalblock">
<div class="content">
<pre><code>bind generic I !git add -i %(file)</code></pre>
</div></div>
</li>
<li>
<p>
Rebase current branch on top of the selected branch:
</p>
<div class="literalblock">
<div class="content">
<pre><code>bind refs 3 !git rebase -i %(branch)</code></pre>
</div></div>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="title-window">2.3. Title Windows</h3>
<div class="paragraph"><p>Each view has a title window which shows the name of the view, current commit
ID if available, and where the view is positioned:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)</code></pre>
</div></div>
<div class="paragraph"><p>By default, the title of the current view is highlighted using bold font. For
long loading views (taking over 3 seconds) the time since loading started will
be appended:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s</code></pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="env-variables">3. Environment Variables</h2>
<div class="sectionbody">
<div class="paragraph"><p>Several options related to the interface with Git can be configured via
environment options.</p></div>
<div class="sect2">
<h3 id="configuration-files">3.1. Configuration Files</h3>
<div class="paragraph"><p>Upon startup, Tig first reads the system wide configuration file
(<code>{sysconfdir}/tigrc</code> by default) and then proceeds to read the user’s
configuration file (<code>~/.tigrc</code> or <code>$XDG_CONFIG_HOME/tig/config</code> by default).
The paths to either of these files can be overridden through the following
environment variables:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
TIGRC_USER
</dt>
<dd>
<p>
Path of the user configuration file.
</p>
</dd>
<dt class="hdlist1">
TIGRC_SYSTEM
</dt>
<dd>
<p>
Path of the system wide configuration file.
</p>
</dd>
</dl></div>
<div class="paragraph" id="history-files"><p>History Files</p></div>
<div class="listingblock">
<div class="content">
<pre><code>If compiled with readline support, Tig writes a persistent command and search
history to `~/.tig_history` or `$XDG_DATA_HOME/tig/history`.
[[repo-refs]]
Repository References</code></pre>
</div></div>
<div class="paragraph"><p>Commits that are referenced by tags and branch heads will be marked by the
reference name surrounded by <em>[</em> and <em>]</em>:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>2006-03-26 19:42 Petr Baudis | [cogito-0.17.1] Cogito 0.17.1</code></pre>
</div></div>
<div class="paragraph"><p>If you want to limit what branches are shown, say only show branches named
<code>master</code> or those which start with the <code>feature/</code> prefix, you can do it by setting
the following variable:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ TIG_LS_REMOTE="git ls-remote . master feature/*" tig</code></pre>
</div></div>
<div class="paragraph"><p>Or set the variable permanently in your environment.</p></div>
<div class="openblock">
<div class="content">
<div class="dlist"><dl>
<dt class="hdlist1">
TIG_LS_REMOTE
</dt>
<dd>
<p>
Command for retrieving all repository references. The command should
output data in the same format as git-ls-remote(1). Defaults to:
</p>
</dd>
</dl></div>
<div class="listingblock">
<div class="content">
<pre><code>git ls-remote .</code></pre>
</div></div>
</div></div>
</div>
<div class="sect2">
<h3 id="diff-options">3.2. Diff options</h3>
<div class="paragraph"><p>It is possible to alter how diffs are shown by the diff view. If for example
you prefer to have commit and author dates shown as relative dates, use:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ TIG_DIFF_OPTS="--relative-date" tig</code></pre>
</div></div>
<div class="paragraph"><p>Or set the variable permanently in your environment.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="keys">4. Default Keybindings</h2>
<div class="sectionbody">
<div class="paragraph"><p>Below the default key bindings are shown.</p></div>
<div class="sect2">
<h3 id="view-switching">4.1. View Switching</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">m</p></td>
<td align="left" valign="top"><p class="table">Switch to main view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">d</p></td>
<td align="left" valign="top"><p class="table">Switch to diff view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">l</p></td>
<td align="left" valign="top"><p class="table">Switch to log view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">p</p></td>
<td align="left" valign="top"><p class="table">Switch to pager view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">t</p></td>
<td align="left" valign="top"><p class="table">Switch to (directory) tree view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">f</p></td>
<td align="left" valign="top"><p class="table">Switch to (file) blob view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">g</p></td>
<td align="left" valign="top"><p class="table">Switch to grep view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">b</p></td>
<td align="left" valign="top"><p class="table">Switch to blame view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">r</p></td>
<td align="left" valign="top"><p class="table">Switch to refs view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">y</p></td>
<td align="left" valign="top"><p class="table">Switch to stash view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">h</p></td>
<td align="left" valign="top"><p class="table">Switch to help view</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">s</p></td>
<td align="left" valign="top"><p class="table">Switch to status view</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">c</p></td>
<td align="left" valign="top"><p class="table">Switch to stage view</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="view-manipulation">4.2. View Manipulation</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">q</p></td>
<td align="left" valign="top"><p class="table">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.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Enter</p></td>
<td align="left" valign="top"><p class="table">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.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Tab</p></td>
<td align="left" valign="top"><p class="table">Switch to next view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">R</p></td>
<td align="left" valign="top"><p class="table">Reload and refresh the current view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">O</p></td>
<td align="left" valign="top"><p class="table">Maximize the current view to fill the whole display.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Up</p></td>
<td align="left" valign="top"><p class="table">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. If you prefer this key to move the cursor or
scroll within the diff view instead, use <code>bind diff <Up> move-up</code>
or <code>bind diff <Up> scroll-line-up</code>, respectively.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Down</p></td>
<td align="left" valign="top"><p class="table">Similar to <em>Up</em> but will move down.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">,</p></td>
<td align="left" valign="top"><p class="table">Move to parent. In the tree view, this means switch to the parent
directory. In the blame view it will load blame for the parent
commit. For merges the parent is queried.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="view-actions">4.3. View Specific Actions</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">u</p></td>
<td align="left" valign="top"><p class="table">Update status of file. In the status view, this allows you to add an
untracked file or stage changes to a file for next commit (similar to
running git-add <filename>). In the stage view, when pressing this on
a diff chunk line stages only that chunk for next commit, when not on
a diff chunk line all changes in the displayed diff are staged.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">M</p></td>
<td align="left" valign="top"><p class="table">Resolve unmerged file by launching git-mergetool(1). Note, to work
correctly this might require some initial configuration of your
preferred merge tool. See the manpage of git-mergetool(1).</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">!</p></td>
<td align="left" valign="top"><p class="table">Checkout file with unstaged changes. This will reset the file to
contain the content it had at last commit.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">1</p></td>
<td align="left" valign="top"><p class="table">Stage single diff line.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">@</p></td>
<td align="left" valign="top"><p class="table">Move to next chunk in the stage view.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">]</p></td>
<td align="left" valign="top"><p class="table">Increase the diff context.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">[</p></td>
<td align="left" valign="top"><p class="table">Decrease the diff context.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="cursor-nav">4.4. Cursor Navigation</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">k</p></td>
<td align="left" valign="top"><p class="table">Move cursor one line up.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">j</p></td>
<td align="left" valign="top"><p class="table">Move cursor one line down.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">PgUp,-,a</p></td>
<td align="left" valign="top"><p class="table">Move cursor one page up.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">PgDown, Space</p></td>
<td align="left" valign="top"><p class="table">Move cursor one page down.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">End</p></td>
<td align="left" valign="top"><p class="table">Jump to last line.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Home</p></td>
<td align="left" valign="top"><p class="table">Jump to first line.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="view-scrolling">4.5. Scrolling</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">Insert</p></td>
<td align="left" valign="top"><p class="table">Scroll view one line up.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Delete</p></td>
<td align="left" valign="top"><p class="table">Scroll view one line down.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">ScrollBack</p></td>
<td align="left" valign="top"><p class="table">Scroll view one page up.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">ScrollFwd</p></td>
<td align="left" valign="top"><p class="table">Scroll view one page down.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Left</p></td>
<td align="left" valign="top"><p class="table">Scroll view one column left.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">Right</p></td>
<td align="left" valign="top"><p class="table">Scroll view one column right.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">|</p></td>
<td align="left" valign="top"><p class="table">Scroll view to the first column.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="searching">4.6. Searching</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">/</p></td>
<td align="left" valign="top"><p class="table">Search the view. Opens a prompt for entering search regexp to use.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">?</p></td>
<td align="left" valign="top"><p class="table">Search backwards in the view. Also prompts for regexp.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">n</p></td>
<td align="left" valign="top"><p class="table">Find next match for the current search regexp.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">N</p></td>
<td align="left" valign="top"><p class="table">Find previous match for the current search regexp.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="misc-keys">4.7. Misc</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">Q</p></td>
<td align="left" valign="top"><p class="table">Quit.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table"><C-L></p></td>
<td align="left" valign="top"><p class="table">Redraw screen.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">z</p></td>
<td align="left" valign="top"><p class="table">Stop all background loading. This can be useful if you use
Tig in a repository with a long history without limiting
the revision log.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">v</p></td>
<td align="left" valign="top"><p class="table">Show version.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">o</p></td>
<td align="left" valign="top"><p class="table">Open option menu</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">#</p></td>
<td align="left" valign="top"><p class="table">Toggle line numbers on/off.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">D</p></td>
<td align="left" valign="top"><p class="table">Toggle date display on/off/relative/relative-compact/custom</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">A</p></td>
<td align="left" valign="top"><p class="table">Toggle author display on/off/abbreviated/email/email user name.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">G</p></td>
<td align="left" valign="top"><p class="table">Toggle revision graph visualization on/off.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">~</p></td>
<td align="left" valign="top"><p class="table">Toggle (line) graphics mode</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">F</p></td>
<td align="left" valign="top"><p class="table">Toggle reference display on/off (tag and branch names).</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">W</p></td>
<td align="left" valign="top"><p class="table">Toggle ignoring whitespace on/off for diffs</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">X</p></td>
<td align="left" valign="top"><p class="table">Toggle commit ID display on/off</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">%</p></td>
<td align="left" valign="top"><p class="table">Toggle file filtering in order to see the full diff instead of only
the diff concerning the currently selected file.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">$</p></td>
<td align="left" valign="top"><p class="table">Toggle highlighting of commit title overflow.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:</p></td>
<td align="left" valign="top"><p class="table">Open prompt. This allows you to specify what command to run and also to
jump to a specific line, e.g. <code>:23</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">e</p></td>
<td align="left" valign="top"><p class="table">Open file in editor.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="prompt">4.8. Prompt</h3>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">:<number></p></td>
<td align="left" valign="top"><p class="table">Jump to the specific line number, e.g. <code>:80</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:<sha></p></td>
<td align="left" valign="top"><p class="table">Jump to a specific commit, e.g. <code>:2f12bcc</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:<x></p></td>
<td align="left" valign="top"><p class="table">Execute the corresponding key binding, e.g. <code>:q</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:!<command></p></td>
<td align="left" valign="top"><p class="table">Execute a system command in a pager, e.g. <code>:!git log -p</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:<action></p></td>
<td align="left" valign="top"><p class="table">Execute a Tig command, e.g. <code>:edit</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:goto <rev></p></td>
<td align="left" valign="top"><p class="table">Jump to a specific revision, e.g. <code>:goto %(commit)^2</code>
to goto the current commit’s 2nd parent or
<code>:goto some/branch</code> to goto the commit denoting the
branch <code>some/branch</code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:save-display <file></p></td>
<td align="left" valign="top"><p class="table">Save current display to <code><file></code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:save-options <file></p></td>
<td align="left" valign="top"><p class="table">Save current options to <code><file></code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:save-view <file></p></td>
<td align="left" valign="top"><p class="table">Save view info to <code><file></code> (for testing purposes).</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:script <file></p></td>
<td align="left" valign="top"><p class="table">Execute commands from <code><file></code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:exec <flags><args…></p></td>
<td align="left" valign="top"><p class="table">Execute command using <code><args></code> with external
user-defined command option flags defined in <code><flags></code>.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">:echo <args…></p></td>
<td align="left" valign="top"><p class="table">Display text in the status bar.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2">
<h3 id="external-commands">4.9. External Commands</h3>
<div class="paragraph"><p>For more custom needs, external commands provide a way to easily execute
a script or program. They are bound to keys and use information from the
current browsing state, such as the current commit ID. Tig comes with
the following built-in external commands:</p></div>
<div class="tableblock">
<table rules="none"
width="100%"
frame="void"
cellspacing="0" cellpadding="4">
<col width="10%" />
<col width="10%" />
<col width="80%" />
<thead>
<tr>
<th align="left" valign="top">Keymap </th>
<th align="left" valign="top">Key </th>
<th align="left" valign="top">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p class="table">main</p></td>
<td align="left" valign="top"><p class="table">C</p></td>
<td align="left" valign="top"><p class="table">git cherry-pick %(commit)</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">status</p></td>
<td align="left" valign="top"><p class="table">C</p></td>
<td align="left" valign="top"><p class="table">git commit</p></td>
</tr>
<tr>
<td align="left" valign="top"><p class="table">generic</p></td>
<td align="left" valign="top"><p class="table">G</p></td>
<td align="left" valign="top"><p class="table">git gc</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="refspec">5. Revision Specification</h2>
<div class="sectionbody">
<div class="paragraph"><p>This section describes various ways to specify what revisions to display or
otherwise limit the view to. Tig does not itself parse the described
revision options so refer to the relevant Git man pages for further
information. Relevant man pages besides git-log(1) are git-diff(1) and
git-rev-list(1).</p></div>
<div class="paragraph"><p>You can tune the interaction with Git by making use of the options explained
in this section. For example, by configuring the environment variable
described in the section on <a href="#diff-options">diff options</a>.</p></div>
<div class="sect2">
<h3 id="path-limiting">5.1. Limit by Path Name</h3>
<div class="paragraph"><p>If you are interested only in those revisions that made changes to a specific
file (or even several files) list the files like this:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig Makefile README</code></pre>
</div></div>
<div class="paragraph"><p>To avoid ambiguity with Tig’s subcommands or repository references such as tag
names, be sure to separate file names from other Git options using "<code>--</code>". So
if you have a file named <em>status</em> it will clash with the <em>status</em> subcommand,
and thus you will have to use:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig -- status</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="date-number-limiting">5.2. Limit by Date or Number</h3>
<div class="paragraph"><p>To speed up interaction with Git, you can limit the amount of commits to show
both for the log and main view. Either limit by date using e.g.
<code>--since=1.month</code> or limit by the number of commits using <code>-n400</code>.</p></div>
<div class="paragraph"><p>If you are only interested in changes that happened between two dates you can
use:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig --after="May 5th" --before="2006-05-16 15:44"</code></pre>
</div></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">If you want to avoid having to quote dates containing spaces you can use
"." instead, e.g. <code>--after=May.5th</code>.</td>
</tr></table>
</div>
</div>
<div class="sect2">
<h3 id="commit-range-limiting">5.3. Limiting by Commit Ranges</h3>
<div class="paragraph"><p>Alternatively, commits can be limited to a specific range, such as "all
commits between <em>tag-1.0</em> and <em>tag-2.0</em>". For example:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig tag-1.0..tag-2.0</code></pre>
</div></div>
<div class="paragraph"><p>This way of commit limiting makes it trivial to only browse the commits which
haven’t been pushed to a remote branch. Assuming <em>origin</em> is your upstream
remote branch, using:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig origin..HEAD</code></pre>
</div></div>
<div class="paragraph"><p>will list what will be pushed to the remote branch. Optionally, the ending
<em>HEAD</em> can be left out since it is implied.</p></div>
</div>
<div class="sect2">
<h3 id="reachability-limiting">5.4. Limiting by Reachability</h3>
<div class="paragraph"><p>Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits
reachable from <em>tag-2.0</em> but not from <em>tag-1.0</em>". Where reachability refers
to what commits are ancestors (or part of the history) of the branch or tagged
revision in question.</p></div>
<div class="paragraph"><p>If you prefer to specify which commit to preview in this way use the
following:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig tag-2.0 ^tag-1.0</code></pre>
</div></div>
<div class="paragraph"><p>You can think of <em>^</em> as a negation operator. Using this alternate syntax, it
is possible to further prune commits by specifying multiple branch cut offs.</p></div>
</div>
<div class="sect2">
<h3 id="refspec-combi">5.5. Combining Revisions Specification</h3>
<div class="paragraph"><p>Revision options can to some degree be combined, which makes it possible to
say "show at most 20 commits from within the last month that changed files
under the Documentation/ directory."</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig --since=1.month -n20 -- Documentation/</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="refspec-all">5.6. Examining All Repository References</h3>
<div class="paragraph"><p>In some cases, it can be useful to query changes across all references in a
repository. An example is to ask "did any line of development in this
repository change a particular file within the last week". This can be
accomplished using:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ tig --all --since=1.week -- Makefile</code></pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_more_information">6. More Information</h2>
<div class="sectionbody">
<div class="paragraph"><p>Please visit Tig’s <a href="https://jonas.github.io/tig">home page</a> or
<a href="https://github.com/jonas/tig">main Git repository</a> for information about
new releases and how to report bugs and feature requests.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="copy-right">7. Copyright</h2>
<div class="sectionbody">
<div class="paragraph"><p>Copyright (c) 2006-2014 Jonas Fonseca <<a href="mailto:jonas.fonseca@gmail.com">jonas.fonseca@gmail.com</a>></p></div>
<div class="paragraph"><p>This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="references">8. See Also</h2>
<div class="sectionbody">
<div class="paragraph"><p>Manpages:</p></div>
<div class="ulist"><ul>
<li>
<p>
<a href="tig.1.html">tig(1)</a>
</p>
</li>
<li>
<p>
<a href="tigrc.5.html">tigrc(5)</a>
</p>
</li>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated
2018-07-27 03:18:19 UTC
</div>
</div>
</body>
</html>