Autogenerated HTML docs for v2.45.1-204-gd8ab1
[git-htmldocs.git] / git-log.html
blob600c6efaf2bf68f4bc28534cd0901f148fef1096
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
7 <meta name="generator" content="AsciiDoc 10.2.0" />
8 <title>git-log(1)</title>
9 <style type="text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12 /* Default font. */
13 body {
14 font-family: Georgia,serif;
17 /* Title font. */
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
21 #toctitle,
22 #author, #revnumber, #revdate, #revremark,
23 #footer {
24 font-family: Arial,Helvetica,sans-serif;
27 body {
28 margin: 1em 5% 1em 5%;
31 a {
32 color: blue;
33 text-decoration: underline;
35 a:visited {
36 color: fuchsia;
39 em {
40 font-style: italic;
41 color: navy;
44 strong {
45 font-weight: bold;
46 color: #083194;
49 h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
51 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
56 h1, h2, h3 {
57 border-bottom: 2px solid silver;
59 h2 {
60 padding-top: 0.5em;
62 h3 {
63 float: left;
65 h3 + * {
66 clear: left;
68 h5 {
69 font-size: 1.0em;
72 div.sectionbody {
73 margin-left: 0;
76 hr {
77 border: 1px solid silver;
80 p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
85 ul, ol, li > p {
86 margin-top: 0;
88 ul > li { color: #aaa; }
89 ul > li > * { color: black; }
91 .monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
95 padding: 0;
96 margin: 0;
98 pre {
99 white-space: pre-wrap;
102 #author {
103 color: #527bbd;
104 font-weight: bold;
105 font-size: 1.1em;
107 #email {
109 #revnumber, #revdate, #revremark {
112 #footer {
113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
118 #footer-text {
119 float: left;
120 padding-bottom: 0.5em;
122 #footer-badges {
123 float: right;
124 padding-bottom: 0.5em;
127 #preamble {
128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
137 div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
144 div.content { /* Block element content. */
145 padding: 0;
148 /* Block element titles. */
149 div.title, caption.title {
150 color: #527bbd;
151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
156 div.title + * {
157 margin-top: 0;
160 td div.title:first-child {
161 margin-top: 0.0em;
163 div.content div.title:first-child {
164 margin-top: 0.0em;
166 div.content + div.title {
167 margin-top: 0.0em;
170 div.sidebarblock > div.content {
171 background: #ffffee;
172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
174 padding: 0.5em;
177 div.listingblock > div.content {
178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
181 padding: 0.5em;
184 div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
188 border-left: 5px solid #f0f0f0;
189 color: #888;
192 div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
197 div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
201 div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
207 text-align: left;
210 div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
218 div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
223 div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
228 div.imageblock div.content { padding-left: 0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
232 dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
236 dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
242 dd > *:first-child {
243 margin-top: 0.1em;
246 ul, ol {
247 list-style-position: outside;
249 ol.arabic {
250 list-style-type: decimal;
252 ol.loweralpha {
253 list-style-type: lower-alpha;
255 ol.upperalpha {
256 list-style-type: upper-alpha;
258 ol.lowerroman {
259 list-style-type: lower-roman;
261 ol.upperroman {
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
272 tfoot {
273 font-weight: bold;
275 td > div.verse {
276 white-space: pre;
279 div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
283 div.hdlist tr {
284 padding-bottom: 15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
289 td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
295 td.hdlist2 {
296 vertical-align: top;
298 div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
303 .comment {
304 background: yellow;
307 .footnote, .footnoteref {
308 font-size: 0.8em;
311 span.footnote, span.footnoteref {
312 vertical-align: super;
315 #footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
320 #footnotes div.footnote {
321 margin: 0 0 5px 0;
324 #footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
334 div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
339 div.colist td img {
340 margin-top: 0.3em;
343 @media print {
344 #footer-badges { display: none; }
347 #toc {
348 margin-bottom: 2.5em;
351 #toctitle {
352 color: #527bbd;
353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
360 margin-top: 0;
361 margin-bottom: 0;
363 div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
367 div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
371 div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size: 2em; }
411 span.small { font-size: 0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
421 * xhtml11 specific
423 * */
425 div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
429 div.tableblock > table {
430 border: 3px solid #527bbd;
432 thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
436 p.table {
437 margin-top: 0;
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock > table[frame="void"] {
441 border-style: none;
443 div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
454 * html5 specific
456 * */
458 table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
462 thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
466 p.tableblock {
467 margin-top: 0;
469 table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
498 th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
501 th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
505 th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
517 * manpage specific
519 * */
521 body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
527 body.manpage h2 {
528 border-style: none;
530 body.manpage div.sectionbody {
531 margin-left: 3em;
534 @media print {
535 body.manpage div#toc { display: none; }
539 </style>
540 <script type="text/javascript">
541 /*<![CDATA[*/
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
552 * Version: 0.4
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561 // toclevels = 1..4.
562 toc: function (toclevels) {
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
572 return text;
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 iterate(i);
598 iterate(el);
599 return result;
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
708 install: function(toclevels) {
709 var timerId;
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
731 asciidoc.install();
732 /*]]>*/
733 </script>
734 </head>
735 <body class="manpage">
736 <div id="header">
737 <h1>
738 git-log(1) Manual Page
739 </h1>
740 <h2>NAME</h2>
741 <div class="sectionbody">
742 <p>git-log -
743 Show commit logs
744 </p>
745 </div>
746 </div>
747 <div id="content">
748 <div class="sect1">
749 <h2 id="_synopsis">SYNOPSIS</h2>
750 <div class="sectionbody">
751 <div class="verseblock">
752 <pre class="content"><em>git log</em> [&lt;options&gt;] [&lt;revision-range&gt;] [[--] &lt;path&gt;&#8230;]</pre>
753 <div class="attribution">
754 </div></div>
755 </div>
756 </div>
757 <div class="sect1">
758 <h2 id="_description">DESCRIPTION</h2>
759 <div class="sectionbody">
760 <div class="paragraph"><p>Shows the commit logs.</p></div>
761 <div class="paragraph"><p>List commits that are reachable by following the <code>parent</code> links from the
762 given commit(s), but exclude commits that are reachable from the one(s)
763 given with a <em>&#94;</em> in front of them. The output is given in reverse
764 chronological order by default.</p></div>
765 <div class="paragraph"><p>You can think of this as a set operation. Commits reachable from any of
766 the commits given on the command line form a set, and then commits reachable
767 from any of the ones given with <em>&#94;</em> in front are subtracted from that
768 set. The remaining commits are what comes out in the command&#8217;s output.
769 Various other options and paths parameters can be used to further limit the
770 result.</p></div>
771 <div class="paragraph"><p>Thus, the following command:</p></div>
772 <div class="listingblock">
773 <div class="content">
774 <pre><code>$ git log foo bar ^baz</code></pre>
775 </div></div>
776 <div class="paragraph"><p>means "list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but
777 not from <em>baz</em>".</p></div>
778 <div class="paragraph"><p>A special notation "<em>&lt;commit1&gt;</em>..<em>&lt;commit2&gt;</em>" can be used as a
779 short-hand for "^<em>&lt;commit1&gt;</em> <em>&lt;commit2&gt;</em>". For example, either of
780 the following may be used interchangeably:</p></div>
781 <div class="listingblock">
782 <div class="content">
783 <pre><code>$ git log origin..HEAD
784 $ git log HEAD ^origin</code></pre>
785 </div></div>
786 <div class="paragraph"><p>Another special notation is "<em>&lt;commit1&gt;</em>&#8230;<em>&lt;commit2&gt;</em>" which is useful
787 for merges. The resulting set of commits is the symmetric difference
788 between the two operands. The following two commands are equivalent:</p></div>
789 <div class="listingblock">
790 <div class="content">
791 <pre><code>$ git log A B --not $(git merge-base --all A B)
792 $ git log A...B</code></pre>
793 </div></div>
794 <div class="paragraph"><p>The command takes options applicable to the <a href="git-rev-list.html">git-rev-list(1)</a>
795 command to control what is shown and how, and options applicable to
796 the <a href="git-diff.html">git-diff(1)</a> command to control how the changes
797 each commit introduces are shown.</p></div>
798 </div>
799 </div>
800 <div class="sect1">
801 <h2 id="_options">OPTIONS</h2>
802 <div class="sectionbody">
803 <div class="dlist"><dl>
804 <dt class="hdlist1">
805 --follow
806 </dt>
807 <dd>
809 Continue listing the history of a file beyond renames
810 (works only for a single file).
811 </p>
812 </dd>
813 <dt class="hdlist1">
814 --no-decorate
815 </dt>
816 <dt class="hdlist1">
817 --decorate[=short|full|auto|no]
818 </dt>
819 <dd>
821 Print out the ref names of any commits that are shown. If <em>short</em> is
822 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
823 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
824 full ref name (including prefix) will be printed. If <em>auto</em> is
825 specified, then if the output is going to a terminal, the ref names
826 are shown as if <em>short</em> were given, otherwise no ref names are
827 shown. The option <code>--decorate</code> is short-hand for <code>--decorate=short</code>.
828 Default to configuration value of <code>log.decorate</code> if configured,
829 otherwise, <code>auto</code>.
830 </p>
831 </dd>
832 <dt class="hdlist1">
833 --decorate-refs=&lt;pattern&gt;
834 </dt>
835 <dt class="hdlist1">
836 --decorate-refs-exclude=&lt;pattern&gt;
837 </dt>
838 <dd>
840 For each candidate reference, do not use it for decoration if it
841 matches any patterns given to <code>--decorate-refs-exclude</code> or if it
842 doesn&#8217;t match any of the patterns given to <code>--decorate-refs</code>. The
843 <code>log.excludeDecoration</code> config option allows excluding refs from
844 the decorations, but an explicit <code>--decorate-refs</code> pattern will
845 override a match in <code>log.excludeDecoration</code>.
846 </p>
847 <div class="paragraph"><p>If none of these options or config settings are given, then references are
848 used as decoration if they match <code>HEAD</code>, <code>refs/heads/</code>, <code>refs/remotes/</code>,
849 <code>refs/stash/</code>, or <code>refs/tags/</code>.</p></div>
850 </dd>
851 <dt class="hdlist1">
852 --clear-decorations
853 </dt>
854 <dd>
856 When specified, this option clears all previous <code>--decorate-refs</code>
857 or <code>--decorate-refs-exclude</code> options and relaxes the default
858 decoration filter to include all references. This option is
859 assumed if the config value <code>log.initialDecorationSet</code> is set to
860 <code>all</code>.
861 </p>
862 </dd>
863 <dt class="hdlist1">
864 --source
865 </dt>
866 <dd>
868 Print out the ref name given on the command line by which each
869 commit was reached.
870 </p>
871 </dd>
872 <dt class="hdlist1">
873 --[no-]mailmap
874 </dt>
875 <dt class="hdlist1">
876 --[no-]use-mailmap
877 </dt>
878 <dd>
880 Use mailmap file to map author and committer names and email
881 addresses to canonical real names and email addresses. See
882 <a href="git-shortlog.html">git-shortlog(1)</a>.
883 </p>
884 </dd>
885 <dt class="hdlist1">
886 --full-diff
887 </dt>
888 <dd>
890 Without this flag, <code>git log -p &lt;path&gt;...</code> shows commits that
891 touch the specified paths, and diffs about the same specified
892 paths. With this, the full diff is shown for commits that touch
893 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
894 commits, and doesn&#8217;t limit diff for those commits.
895 </p>
896 <div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
897 produced by <code>--stat</code>, etc.</p></div>
898 </dd>
899 <dt class="hdlist1">
900 --log-size
901 </dt>
902 <dd>
904 Include a line &#8220;log size &lt;number&gt;&#8221; in the output for each commit,
905 where &lt;number&gt; is the length of that commit&#8217;s message in bytes.
906 Intended to speed up tools that read log messages from <code>git log</code>
907 output by allowing them to allocate space in advance.
908 </p>
909 </dd>
910 <dt class="hdlist1">
911 -L&lt;start&gt;,&lt;end&gt;:&lt;file&gt;
912 </dt>
913 <dt class="hdlist1">
914 -L:&lt;funcname&gt;:&lt;file&gt;
915 </dt>
916 <dd>
918 Trace the evolution of the line range given by <em>&lt;start&gt;,&lt;end&gt;</em>,
919 or by the function name regex <em>&lt;funcname&gt;</em>, within the <em>&lt;file&gt;</em>. You may
920 not give any pathspec limiters. This is currently limited to
921 a walk starting from a single revision, i.e., you may only
922 give zero or one positive revision arguments, and
923 <em>&lt;start&gt;</em> and <em>&lt;end&gt;</em> (or <em>&lt;funcname&gt;</em>) must exist in the starting revision.
924 You can specify this option more than once. Implies <code>--patch</code>.
925 Patch output can be suppressed using <code>--no-patch</code>, but other diff formats
926 (namely <code>--raw</code>, <code>--numstat</code>, <code>--shortstat</code>, <code>--dirstat</code>, <code>--summary</code>,
927 <code>--name-only</code>, <code>--name-status</code>, <code>--check</code>) are not currently implemented.
928 </p>
929 <div class="paragraph"><p><em>&lt;start&gt;</em> and <em>&lt;end&gt;</em> can take one of these forms:</p></div>
930 <div class="ulist"><ul>
931 <li>
933 number
934 </p>
935 <div class="paragraph"><p>If <em>&lt;start&gt;</em> or <em>&lt;end&gt;</em> is a number, it specifies an
936 absolute line number (lines count from 1).</p></div>
937 </li>
938 <li>
940 <code>/regex/</code>
941 </p>
942 <div class="paragraph"><p>This form will use the first line matching the given
943 POSIX regex. If <em>&lt;start&gt;</em> is a regex, it will search from the end of
944 the previous <code>-L</code> range, if any, otherwise from the start of file.
945 If <em>&lt;start&gt;</em> is <code>^/regex/</code>, it will search from the start of file.
946 If <em>&lt;end&gt;</em> is a regex, it will search
947 starting at the line given by <em>&lt;start&gt;</em>.</p></div>
948 </li>
949 <li>
951 +offset or -offset
952 </p>
953 <div class="paragraph"><p>This is only valid for <em>&lt;end&gt;</em> and will specify a number
954 of lines before or after the line given by <em>&lt;start&gt;</em>.</p></div>
955 </li>
956 </ul></div>
957 <div class="paragraph"><p>If <code>:&lt;funcname&gt;</code> is given in place of <em>&lt;start&gt;</em> and <em>&lt;end&gt;</em>, it is a
958 regular expression that denotes the range from the first funcname line
959 that matches <em>&lt;funcname&gt;</em>, up to the next funcname line. <code>:&lt;funcname&gt;</code>
960 searches from the end of the previous <code>-L</code> range, if any, otherwise
961 from the start of file. <code>^:&lt;funcname&gt;</code> searches from the start of
962 file. The function names are determined in the same way as <code>git diff</code>
963 works out patch hunk headers (see <em>Defining a custom hunk-header</em>
964 in <a href="gitattributes.html">gitattributes(5)</a>).</p></div>
965 </dd>
966 <dt class="hdlist1">
967 &lt;revision-range&gt;
968 </dt>
969 <dd>
971 Show only commits in the specified revision range. When no
972 &lt;revision-range&gt; is specified, it defaults to <code>HEAD</code> (i.e. the
973 whole history leading to the current commit). <code>origin..HEAD</code>
974 specifies all the commits reachable from the current commit
975 (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of
976 ways to spell &lt;revision-range&gt;, see the <em>Specifying Ranges</em>
977 section of <a href="gitrevisions.html">gitrevisions(7)</a>.
978 </p>
979 </dd>
980 <dt class="hdlist1">
981 [--] &lt;path&gt;&#8230;
982 </dt>
983 <dd>
985 Show only commits that are enough to explain how the files
986 that match the specified paths came to be. See <em>History
987 Simplification</em> below for details and other simplification
988 modes.
989 </p>
990 <div class="paragraph"><p>Paths may need to be prefixed with <code>--</code> to separate them from
991 options or the revision range, when confusion arises.</p></div>
992 </dd>
993 </dl></div>
994 <div class="sect2">
995 <h3 id="_commit_limiting">Commit Limiting</h3>
996 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
997 special notations explained in the description, additional commit
998 limiting may be applied.</p></div>
999 <div class="paragraph"><p>Using more options generally further limits the output (e.g.
1000 <code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
1001 with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
1002 has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
1003 <div class="paragraph"><p>Note that these are applied before commit
1004 ordering and formatting options, such as <code>--reverse</code>.</p></div>
1005 <div class="dlist"><dl>
1006 <dt class="hdlist1">
1007 -&lt;number&gt;
1008 </dt>
1009 <dt class="hdlist1">
1010 -n &lt;number&gt;
1011 </dt>
1012 <dt class="hdlist1">
1013 --max-count=&lt;number&gt;
1014 </dt>
1015 <dd>
1017 Limit the number of commits to output.
1018 </p>
1019 </dd>
1020 <dt class="hdlist1">
1021 --skip=&lt;number&gt;
1022 </dt>
1023 <dd>
1025 Skip <em>number</em> commits before starting to show the commit output.
1026 </p>
1027 </dd>
1028 <dt class="hdlist1">
1029 --since=&lt;date&gt;
1030 </dt>
1031 <dt class="hdlist1">
1032 --after=&lt;date&gt;
1033 </dt>
1034 <dd>
1036 Show commits more recent than a specific date.
1037 </p>
1038 </dd>
1039 <dt class="hdlist1">
1040 --since-as-filter=&lt;date&gt;
1041 </dt>
1042 <dd>
1044 Show all commits more recent than a specific date. This visits
1045 all commits in the range, rather than stopping at the first commit which
1046 is older than a specific date.
1047 </p>
1048 </dd>
1049 <dt class="hdlist1">
1050 --until=&lt;date&gt;
1051 </dt>
1052 <dt class="hdlist1">
1053 --before=&lt;date&gt;
1054 </dt>
1055 <dd>
1057 Show commits older than a specific date.
1058 </p>
1059 </dd>
1060 <dt class="hdlist1">
1061 --author=&lt;pattern&gt;
1062 </dt>
1063 <dt class="hdlist1">
1064 --committer=&lt;pattern&gt;
1065 </dt>
1066 <dd>
1068 Limit the commits output to ones with author/committer
1069 header lines that match the specified pattern (regular
1070 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
1071 commits whose author matches any of the given patterns are
1072 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
1073 </p>
1074 </dd>
1075 <dt class="hdlist1">
1076 --grep-reflog=&lt;pattern&gt;
1077 </dt>
1078 <dd>
1080 Limit the commits output to ones with reflog entries that
1081 match the specified pattern (regular expression). With
1082 more than one <code>--grep-reflog</code>, commits whose reflog message
1083 matches any of the given patterns are chosen. It is an
1084 error to use this option unless <code>--walk-reflogs</code> is in use.
1085 </p>
1086 </dd>
1087 <dt class="hdlist1">
1088 --grep=&lt;pattern&gt;
1089 </dt>
1090 <dd>
1092 Limit the commits output to ones with a log message that
1093 matches the specified pattern (regular expression). With
1094 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
1095 matches any of the given patterns are chosen (but see
1096 <code>--all-match</code>).
1097 </p>
1098 <div class="paragraph"><p>When <code>--notes</code> is in effect, the message from the notes is
1099 matched as if it were part of the log message.</p></div>
1100 </dd>
1101 <dt class="hdlist1">
1102 --all-match
1103 </dt>
1104 <dd>
1106 Limit the commits output to ones that match all given <code>--grep</code>,
1107 instead of ones that match at least one.
1108 </p>
1109 </dd>
1110 <dt class="hdlist1">
1111 --invert-grep
1112 </dt>
1113 <dd>
1115 Limit the commits output to ones with a log message that do not
1116 match the pattern specified with <code>--grep=&lt;pattern&gt;</code>.
1117 </p>
1118 </dd>
1119 <dt class="hdlist1">
1121 </dt>
1122 <dt class="hdlist1">
1123 --regexp-ignore-case
1124 </dt>
1125 <dd>
1127 Match the regular expression limiting patterns without regard to letter
1128 case.
1129 </p>
1130 </dd>
1131 <dt class="hdlist1">
1132 --basic-regexp
1133 </dt>
1134 <dd>
1136 Consider the limiting patterns to be basic regular expressions;
1137 this is the default.
1138 </p>
1139 </dd>
1140 <dt class="hdlist1">
1142 </dt>
1143 <dt class="hdlist1">
1144 --extended-regexp
1145 </dt>
1146 <dd>
1148 Consider the limiting patterns to be extended regular expressions
1149 instead of the default basic regular expressions.
1150 </p>
1151 </dd>
1152 <dt class="hdlist1">
1154 </dt>
1155 <dt class="hdlist1">
1156 --fixed-strings
1157 </dt>
1158 <dd>
1160 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
1161 pattern as a regular expression).
1162 </p>
1163 </dd>
1164 <dt class="hdlist1">
1166 </dt>
1167 <dt class="hdlist1">
1168 --perl-regexp
1169 </dt>
1170 <dd>
1172 Consider the limiting patterns to be Perl-compatible regular
1173 expressions.
1174 </p>
1175 <div class="paragraph"><p>Support for these types of regular expressions is an optional
1176 compile-time dependency. If Git wasn&#8217;t compiled with support for them
1177 providing this option will cause it to die.</p></div>
1178 </dd>
1179 <dt class="hdlist1">
1180 --remove-empty
1181 </dt>
1182 <dd>
1184 Stop when a given path disappears from the tree.
1185 </p>
1186 </dd>
1187 <dt class="hdlist1">
1188 --merges
1189 </dt>
1190 <dd>
1192 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
1193 </p>
1194 </dd>
1195 <dt class="hdlist1">
1196 --no-merges
1197 </dt>
1198 <dd>
1200 Do not print commits with more than one parent. This is
1201 exactly the same as <code>--max-parents=1</code>.
1202 </p>
1203 </dd>
1204 <dt class="hdlist1">
1205 --min-parents=&lt;number&gt;
1206 </dt>
1207 <dt class="hdlist1">
1208 --max-parents=&lt;number&gt;
1209 </dt>
1210 <dt class="hdlist1">
1211 --no-min-parents
1212 </dt>
1213 <dt class="hdlist1">
1214 --no-max-parents
1215 </dt>
1216 <dd>
1218 Show only commits which have at least (or at most) that many parent
1219 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1220 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1221 gives all root commits and <code>--min-parents=3</code> all octopus merges.
1222 </p>
1223 <div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1224 again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1225 parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
1226 </dd>
1227 <dt class="hdlist1">
1228 --first-parent
1229 </dt>
1230 <dd>
1232 When finding commits to include, follow only the first
1233 parent commit upon seeing a merge commit. This option
1234 can give a better overview when viewing the evolution of
1235 a particular topic branch, because merges into a topic
1236 branch tend to be only about adjusting to updated upstream
1237 from time to time, and this option allows you to ignore
1238 the individual commits brought in to your history by such
1239 a merge.
1240 </p>
1241 <div class="paragraph"><p>This option also changes default diff format for merge commits
1242 to <code>first-parent</code>, see <code>--diff-merges=first-parent</code> for details.</p></div>
1243 </dd>
1244 <dt class="hdlist1">
1245 --exclude-first-parent-only
1246 </dt>
1247 <dd>
1249 When finding commits to exclude (with a <em>&#94;</em>), follow only
1250 the first parent commit upon seeing a merge commit.
1251 This can be used to find the set of changes in a topic branch
1252 from the point where it diverged from the remote branch, given
1253 that arbitrary merges can be valid topic branch changes.
1254 </p>
1255 </dd>
1256 <dt class="hdlist1">
1257 --not
1258 </dt>
1259 <dd>
1261 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
1262 for all following revision specifiers, up to the next <code>--not</code>.
1263 When used on the command line before --stdin, the revisions passed
1264 through stdin will not be affected by it. Conversely, when passed
1265 via standard input, the revisions passed on the command line will
1266 not be affected by it.
1267 </p>
1268 </dd>
1269 <dt class="hdlist1">
1270 --all
1271 </dt>
1272 <dd>
1274 Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are
1275 listed on the command line as <em>&lt;commit&gt;</em>.
1276 </p>
1277 </dd>
1278 <dt class="hdlist1">
1279 --branches[=&lt;pattern&gt;]
1280 </dt>
1281 <dd>
1283 Pretend as if all the refs in <code>refs/heads</code> are listed
1284 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1285 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
1286 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1287 </p>
1288 </dd>
1289 <dt class="hdlist1">
1290 --tags[=&lt;pattern&gt;]
1291 </dt>
1292 <dd>
1294 Pretend as if all the refs in <code>refs/tags</code> are listed
1295 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1296 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1297 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1298 </p>
1299 </dd>
1300 <dt class="hdlist1">
1301 --remotes[=&lt;pattern&gt;]
1302 </dt>
1303 <dd>
1305 Pretend as if all the refs in <code>refs/remotes</code> are listed
1306 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1307 remote-tracking branches to ones matching given shell glob.
1308 If pattern lacks <em>?</em>, <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1309 </p>
1310 </dd>
1311 <dt class="hdlist1">
1312 --glob=&lt;glob-pattern&gt;
1313 </dt>
1314 <dd>
1316 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
1317 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
1318 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1319 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1320 </p>
1321 </dd>
1322 <dt class="hdlist1">
1323 --exclude=&lt;glob-pattern&gt;
1324 </dt>
1325 <dd>
1327 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1328 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
1329 consider. Repetitions of this option accumulate exclusion patterns
1330 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1331 <code>--glob</code> option (other options or arguments do not clear
1332 accumulated patterns).
1333 </p>
1334 <div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1335 <code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1336 respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1337 or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
1338 explicitly.</p></div>
1339 </dd>
1340 <dt class="hdlist1">
1341 --exclude-hidden=[fetch|receive|uploadpack]
1342 </dt>
1343 <dd>
1345 Do not include refs that would be hidden by <code>git-fetch</code>,
1346 <code>git-receive-pack</code> or <code>git-upload-pack</code> by consulting the appropriate
1347 <code>fetch.hideRefs</code>, <code>receive.hideRefs</code> or <code>uploadpack.hideRefs</code>
1348 configuration along with <code>transfer.hideRefs</code> (see
1349 <a href="git-config.html">git-config(1)</a>). This option affects the next pseudo-ref option
1350 <code>--all</code> or <code>--glob</code> and is cleared after processing them.
1351 </p>
1352 </dd>
1353 <dt class="hdlist1">
1354 --reflog
1355 </dt>
1356 <dd>
1358 Pretend as if all objects mentioned by reflogs are listed on the
1359 command line as <code>&lt;commit&gt;</code>.
1360 </p>
1361 </dd>
1362 <dt class="hdlist1">
1363 --alternate-refs
1364 </dt>
1365 <dd>
1367 Pretend as if all objects mentioned as ref tips of alternate
1368 repositories were listed on the command line. An alternate
1369 repository is any repository whose object directory is specified
1370 in <code>objects/info/alternates</code>. The set of included objects may
1371 be modified by <code>core.alternateRefsCommand</code>, etc. See
1372 <a href="git-config.html">git-config(1)</a>.
1373 </p>
1374 </dd>
1375 <dt class="hdlist1">
1376 --single-worktree
1377 </dt>
1378 <dd>
1380 By default, all working trees will be examined by the
1381 following options when there are more than one (see
1382 <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and
1383 <code>--indexed-objects</code>.
1384 This option forces them to examine the current working tree
1385 only.
1386 </p>
1387 </dd>
1388 <dt class="hdlist1">
1389 --ignore-missing
1390 </dt>
1391 <dd>
1393 Upon seeing an invalid object name in the input, pretend as if
1394 the bad input was not given.
1395 </p>
1396 </dd>
1397 <dt class="hdlist1">
1398 --bisect
1399 </dt>
1400 <dd>
1402 Pretend as if the bad bisection ref <code>refs/bisect/bad</code>
1403 was listed and as if it was followed by <code>--not</code> and the good
1404 bisection refs <code>refs/bisect/good-*</code> on the command
1405 line.
1406 </p>
1407 </dd>
1408 <dt class="hdlist1">
1409 --stdin
1410 </dt>
1411 <dd>
1413 In addition to getting arguments from the command line, read
1414 them from standard input as well. This accepts commits and
1415 pseudo-options like <code>--all</code> and <code>--glob=</code>. When a <code>--</code> separator
1416 is seen, the following input is treated as paths and used to
1417 limit the result. Flags like <code>--not</code> which are read via standard input
1418 are only respected for arguments passed in the same way and will not
1419 influence any subsequent command line arguments.
1420 </p>
1421 </dd>
1422 <dt class="hdlist1">
1423 --cherry-mark
1424 </dt>
1425 <dd>
1427 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1428 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
1429 </p>
1430 </dd>
1431 <dt class="hdlist1">
1432 --cherry-pick
1433 </dt>
1434 <dd>
1436 Omit any commit that introduces the same change as
1437 another commit on the &#8220;other side&#8221; when the set of
1438 commits are limited with symmetric difference.
1439 </p>
1440 <div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way
1441 to list all commits on only one side of them is with
1442 <code>--left-right</code> (see the example below in the description of
1443 the <code>--left-right</code> option). However, it shows the commits that were
1444 cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1445 cherry-picked from branch A). With this option, such pairs of commits are
1446 excluded from the output.</p></div>
1447 </dd>
1448 <dt class="hdlist1">
1449 --left-only
1450 </dt>
1451 <dt class="hdlist1">
1452 --right-only
1453 </dt>
1454 <dd>
1456 List only commits on the respective side of a symmetric difference,
1457 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1458 <code>--left-right</code>.
1459 </p>
1460 <div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1461 commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1462 <code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1463 More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
1464 list.</p></div>
1465 </dd>
1466 <dt class="hdlist1">
1467 --cherry
1468 </dt>
1469 <dd>
1471 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
1472 limit the output to the commits on our side and mark those that
1473 have been applied to the other side of a forked history with
1474 <code>git log --cherry upstream...mybranch</code>, similar to
1475 <code>git cherry upstream mybranch</code>.
1476 </p>
1477 </dd>
1478 <dt class="hdlist1">
1480 </dt>
1481 <dt class="hdlist1">
1482 --walk-reflogs
1483 </dt>
1484 <dd>
1486 Instead of walking the commit ancestry chain, walk
1487 reflog entries from the most recent one to older ones.
1488 When this option is used you cannot specify commits to
1489 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
1490 and <em>commit1...commit2</em> notations cannot be used).
1491 </p>
1492 <div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> and <code>reference</code> (for obvious reasons),
1493 this causes the output to have two extra lines of information
1494 taken from the reflog. The reflog designator in the output may be shown
1495 as <code>ref@{&lt;Nth&gt;}</code> (where <em>&lt;Nth&gt;</em> is the reverse-chronological index in the
1496 reflog) or as <code>ref@{&lt;timestamp&gt;}</code> (with the <em>&lt;timestamp&gt;</em> for that entry),
1497 depending on a few rules:</p></div>
1498 <div class="openblock">
1499 <div class="content">
1500 <div class="olist arabic"><ol class="arabic">
1501 <li>
1503 If the starting point is specified as <code>ref@{&lt;Nth&gt;}</code>, show the index
1504 format.
1505 </p>
1506 </li>
1507 <li>
1509 If the starting point was specified as <code>ref@{now}</code>, show the
1510 timestamp format.
1511 </p>
1512 </li>
1513 <li>
1515 If neither was used, but <code>--date</code> was given on the command line, show
1516 the timestamp in the format requested by <code>--date</code>.
1517 </p>
1518 </li>
1519 <li>
1521 Otherwise, show the index format.
1522 </p>
1523 </li>
1524 </ol></div>
1525 </div></div>
1526 <div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is
1527 prefixed with this information on the same line.
1528 This option cannot be combined with <code>--reverse</code>.
1529 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
1530 <div class="paragraph"><p>Under <code>--pretty=reference</code>, this information will not be shown at all.</p></div>
1531 </dd>
1532 <dt class="hdlist1">
1533 --merge
1534 </dt>
1535 <dd>
1537 Show commits touching conflicted paths in the range <code>HEAD...&lt;other&gt;</code>,
1538 where <code>&lt;other&gt;</code> is the first existing pseudoref in <code>MERGE_HEAD</code>,
1539 <code>CHERRY_PICK_HEAD</code>, <code>REVERT_HEAD</code> or <code>REBASE_HEAD</code>. Only works
1540 when the index has unmerged entries. This option can be used to show
1541 relevant commits when resolving conflicts from a 3-way merge.
1542 </p>
1543 </dd>
1544 <dt class="hdlist1">
1545 --boundary
1546 </dt>
1547 <dd>
1549 Output excluded boundary commits. Boundary commits are
1550 prefixed with <code>-</code>.
1551 </p>
1552 </dd>
1553 </dl></div>
1554 </div>
1555 <div class="sect2">
1556 <h3 id="_history_simplification">History Simplification</h3>
1557 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
1558 commits modifying a particular &lt;path&gt;. But there are two parts of
1559 <em>History Simplification</em>, one part is selecting the commits and the other
1560 is how to do it, as there are various strategies to simplify the history.</p></div>
1561 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1562 <div class="dlist"><dl>
1563 <dt class="hdlist1">
1564 &lt;paths&gt;
1565 </dt>
1566 <dd>
1568 Commits modifying the given &lt;paths&gt; are selected.
1569 </p>
1570 </dd>
1571 <dt class="hdlist1">
1572 --simplify-by-decoration
1573 </dt>
1574 <dd>
1576 Commits that are referred by some branch or tag are selected.
1577 </p>
1578 </dd>
1579 </dl></div>
1580 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1581 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1582 <div class="dlist"><dl>
1583 <dt class="hdlist1">
1584 Default mode
1585 </dt>
1586 <dd>
1588 Simplifies the history to the simplest history explaining the
1589 final state of the tree. Simplest because it prunes some side
1590 branches if the end result is the same (i.e. merging branches
1591 with the same content)
1592 </p>
1593 </dd>
1594 <dt class="hdlist1">
1595 --show-pulls
1596 </dt>
1597 <dd>
1599 Include all commits from the default mode, but also any merge
1600 commits that are not TREESAME to the first parent but are
1601 TREESAME to a later parent. This mode is helpful for showing
1602 the merge commits that "first introduced" a change to a branch.
1603 </p>
1604 </dd>
1605 <dt class="hdlist1">
1606 --full-history
1607 </dt>
1608 <dd>
1610 Same as the default mode, but does not prune some history.
1611 </p>
1612 </dd>
1613 <dt class="hdlist1">
1614 --dense
1615 </dt>
1616 <dd>
1618 Only the selected commits are shown, plus some to have a
1619 meaningful history.
1620 </p>
1621 </dd>
1622 <dt class="hdlist1">
1623 --sparse
1624 </dt>
1625 <dd>
1627 All commits in the simplified history are shown.
1628 </p>
1629 </dd>
1630 <dt class="hdlist1">
1631 --simplify-merges
1632 </dt>
1633 <dd>
1635 Additional option to <code>--full-history</code> to remove some needless
1636 merges from the resulting history, as there are no selected
1637 commits contributing to this merge.
1638 </p>
1639 </dd>
1640 <dt class="hdlist1">
1641 --ancestry-path[=&lt;commit&gt;]
1642 </dt>
1643 <dd>
1645 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1646 or <em>commit2 &#94;commit1</em>), only display commits in that range
1647 that are ancestors of &lt;commit&gt;, descendants of &lt;commit&gt;, or
1648 &lt;commit&gt; itself. If no commit is specified, use <em>commit1</em> (the
1649 excluded part of the range) as &lt;commit&gt;. Can be passed multiple
1650 times; if so, a commit is included if it is any of the commits
1651 given or if it is an ancestor or descendant of one of them.
1652 </p>
1653 </dd>
1654 </dl></div>
1655 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
1656 <div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1657 that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1658 filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
1659 <div class="paragraph"><p>In the following, we will always refer to the same example history to
1660 illustrate the differences between simplification settings. We assume
1661 that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
1662 <div class="listingblock">
1663 <div class="content">
1664 <pre><code> .-A---M---N---O---P---Q
1665 / / / / / /
1666 I B C D E Y
1667 \ / / / / /
1668 `-------------' X</code></pre>
1669 </div></div>
1670 <div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of
1671 each merge. The commits are:</p></div>
1672 <div class="ulist"><ul>
1673 <li>
1675 <code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1676 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1677 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
1678 </p>
1679 </li>
1680 <li>
1682 In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
1683 </p>
1684 </li>
1685 <li>
1687 <code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and
1688 hence TREESAME to all parents.
1689 </p>
1690 </li>
1691 <li>
1693 <code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to &#8220;foobar&#8221;,
1694 so it is not TREESAME to any parent.
1695 </p>
1696 </li>
1697 <li>
1699 <code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1700 <code>N</code> and <code>D</code> to &#8220;foobarbaz&#8221;; i.e., it is not TREESAME to any parent.
1701 </p>
1702 </li>
1703 <li>
1705 <code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1706 strings to &#8220;quux xyzzy&#8221;. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>.
1707 </p>
1708 </li>
1709 <li>
1711 <code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1712 modified it. <code>Y</code> is TREESAME to <code>X</code>. Its merge <code>Q</code> added <code>side</code> to <code>P</code>, and
1713 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
1714 </p>
1715 </li>
1716 </ul></div>
1717 <div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1718 commits based on whether <code>--full-history</code> and/or parent rewriting
1719 (via <code>--parents</code> or <code>--children</code>) are used. The following settings
1720 are available.</p></div>
1721 <div class="dlist"><dl>
1722 <dt class="hdlist1">
1723 Default mode
1724 </dt>
1725 <dd>
1727 Commits are included if they are not TREESAME to any parent
1728 (though this can be changed, see <code>--sparse</code> below). If the
1729 commit was a merge, and it was TREESAME to one parent, follow
1730 only that parent. (Even if there are several TREESAME
1731 parents, follow only one of them.) Otherwise, follow all
1732 parents.
1733 </p>
1734 <div class="paragraph"><p>This results in:</p></div>
1735 <div class="listingblock">
1736 <div class="content">
1737 <pre><code> .-A---N---O
1738 / / /
1739 I---------D</code></pre>
1740 </div></div>
1741 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1742 available, removed <code>B</code> from consideration entirely. <code>C</code> was
1743 considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1744 empty tree, so <code>I</code> is !TREESAME.</p></div>
1745 <div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
1746 not affect the commits selected in default mode, so we have shown the
1747 parent lines.</p></div>
1748 </dd>
1749 <dt class="hdlist1">
1750 --full-history without parent rewriting
1751 </dt>
1752 <dd>
1754 This mode differs from the default in one point: always follow
1755 all parents of a merge, even if it is TREESAME to one of them.
1756 Even if more than one side of the merge has commits that are
1757 included, this does not imply that the merge itself is! In
1758 the example, we get
1759 </p>
1760 <div class="listingblock">
1761 <div class="content">
1762 <pre><code> I A B N D O P Q</code></pre>
1763 </div></div>
1764 <div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1765 <code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others
1766 do not appear.</p></div>
1767 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1768 about the parent/child relationships between the commits, so we show
1769 them disconnected.</p></div>
1770 </dd>
1771 <dt class="hdlist1">
1772 --full-history with parent rewriting
1773 </dt>
1774 <dd>
1776 Ordinary commits are only included if they are !TREESAME
1777 (though this can be changed, see <code>--sparse</code> below).
1778 </p>
1779 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1780 Along each parent, prune away commits that are not included
1781 themselves. This results in</p></div>
1782 <div class="listingblock">
1783 <div class="content">
1784 <pre><code> .-A---M---N---O---P---Q
1785 / / / / /
1786 I B / D /
1787 \ / / / /
1788 `-------------'</code></pre>
1789 </div></div>
1790 <div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code>
1791 was pruned away because it is TREESAME, but the parent list of P was
1792 rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1793 <code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
1794 </dd>
1795 </dl></div>
1796 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1797 affects inclusion:</p></div>
1798 <div class="dlist"><dl>
1799 <dt class="hdlist1">
1800 --dense
1801 </dt>
1802 <dd>
1804 Commits that are walked are included if they are not TREESAME
1805 to any parent.
1806 </p>
1807 </dd>
1808 <dt class="hdlist1">
1809 --sparse
1810 </dt>
1811 <dd>
1813 All commits that are walked are included.
1814 </p>
1815 <div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
1816 one of the parents is TREESAME, we follow only that one, so the other
1817 sides of the merge are never walked.</p></div>
1818 </dd>
1819 <dt class="hdlist1">
1820 --simplify-merges
1821 </dt>
1822 <dd>
1824 First, build a history graph in the same way that
1825 <code>--full-history</code> with parent rewriting does (see above).
1826 </p>
1827 <div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final
1828 history according to the following rules:</p></div>
1829 <div class="openblock">
1830 <div class="content">
1831 <div class="ulist"><ul>
1832 <li>
1834 Set <code>C'</code> to <code>C</code>.
1835 </p>
1836 </li>
1837 <li>
1839 Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
1840 the process, drop parents that are ancestors of other parents or that are
1841 root commits TREESAME to an empty tree, and remove duplicates, but take care
1842 to never drop all parents that we are TREESAME to.
1843 </p>
1844 </li>
1845 <li>
1847 If after this parent rewriting, <code>C'</code> is a root or merge commit (has
1848 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1849 Otherwise, it is replaced with its only parent.
1850 </p>
1851 </li>
1852 </ul></div>
1853 </div></div>
1854 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1855 <code>--full-history</code> with parent rewriting. The example turns into:</p></div>
1856 <div class="listingblock">
1857 <div class="content">
1858 <pre><code> .-A---M---N---O
1859 / / /
1860 I B D
1861 \ / /
1862 `---------'</code></pre>
1863 </div></div>
1864 <div class="paragraph"><p>Note the major differences in <code>N</code>, <code>P</code>, and <code>Q</code> over <code>--full-history</code>:</p></div>
1865 <div class="openblock">
1866 <div class="content">
1867 <div class="ulist"><ul>
1868 <li>
1870 <code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1871 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
1872 </p>
1873 </li>
1874 <li>
1876 <code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
1877 removed completely, because it had one parent and is TREESAME.
1878 </p>
1879 </li>
1880 <li>
1882 <code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1883 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
1884 parent and is TREESAME.
1885 </p>
1886 </li>
1887 </ul></div>
1888 </div></div>
1889 </dd>
1890 </dl></div>
1891 <div class="paragraph"><p>There is another simplification mode available:</p></div>
1892 <div class="dlist"><dl>
1893 <dt class="hdlist1">
1894 --ancestry-path[=&lt;commit&gt;]
1895 </dt>
1896 <dd>
1898 Limit the displayed commits to those which are an ancestor of
1899 &lt;commit&gt;, or which are a descendant of &lt;commit&gt;, or are &lt;commit&gt;
1900 itself.
1901 </p>
1902 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1903 <div class="listingblock">
1904 <div class="content">
1905 <pre><code> D---E-------F
1906 / \ \
1907 B---C---G---H---I---J
1909 A-------K---------------L--M</code></pre>
1910 </div></div>
1911 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1912 but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1913 what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1914 that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1915 example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself,
1916 of course).</p></div>
1917 <div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1918 bug introduced by <code>D</code> and need fixing, however, we might want to view
1919 only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1920 excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
1921 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1922 <div class="listingblock">
1923 <div class="content">
1924 <pre><code> E-------F
1926 G---H---I---J
1928 L--M</code></pre>
1929 </div></div>
1930 <div class="paragraph"><p>We can also use <code>--ancestry-path=D</code> instead of <code>--ancestry-path</code> which
1931 means the same thing when applied to the <em>D..M</em> range but is just more
1932 explicit.</p></div>
1933 <div class="paragraph"><p>If we instead are interested in a given topic within this range, and all
1934 commits affected by that topic, we may only want to view the subset of
1935 <code>D..M</code> which contain that topic in their ancestry path. So, using
1936 <code>--ancestry-path=H D..M</code> for example would result in:</p></div>
1937 <div class="listingblock">
1938 <div class="content">
1939 <pre><code> E
1941 G---H---I---J
1943 L--M</code></pre>
1944 </div></div>
1945 <div class="paragraph"><p>Whereas <code>--ancestry-path=K D..M</code> would result in</p></div>
1946 <div class="listingblock">
1947 <div class="content">
1948 <pre><code> K---------------L--M</code></pre>
1949 </div></div>
1950 </dd>
1951 </dl></div>
1952 <div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to
1953 create a new example history.</p></div>
1954 <div class="paragraph"><p>A common problem users face when looking at simplified history is that a
1955 commit they know changed a file somehow does not appear in the file&#8217;s
1956 simplified history. Let&#8217;s demonstrate a new example and show how options
1957 such as <code>--full-history</code> and <code>--simplify-merges</code> works in that case:</p></div>
1958 <div class="listingblock">
1959 <div class="content">
1960 <pre><code> .-A---M-----C--N---O---P
1961 / / \ \ \/ / /
1962 I B \ R-'`-Z' /
1963 \ / \/ /
1964 \ / /\ /
1965 `---X--' `---Y--'</code></pre>
1966 </div></div>
1967 <div class="paragraph"><p>For this example, suppose <code>I</code> created <code>file.txt</code> which was modified by
1968 <code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>,
1969 and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by
1970 resolving the merge conflict to include both changes from <code>A</code> and <code>B</code>
1971 and hence is not TREESAME to either. The merge commit <code>R</code>, however, was
1972 created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only
1973 the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not
1974 <code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the
1975 contents of <code>file.txt</code> at <code>R</code>, so <code>N</code> is TREESAME to <code>R</code> but not <code>C</code>.
1976 The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but
1977 not to their second parents, <code>Z</code> and <code>Y</code> respectively.</p></div>
1978 <div class="paragraph"><p>When using the default mode, <code>N</code> and <code>R</code> both have a TREESAME parent, so
1979 those edges are walked and the others are ignored. The resulting history
1980 graph is:</p></div>
1981 <div class="listingblock">
1982 <div class="content">
1983 <pre><code> I---X</code></pre>
1984 </div></div>
1985 <div class="paragraph"><p>When using <code>--full-history</code>, Git walks every edge. This will discover
1986 the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the
1987 merge commits <code>O</code> and <code>P</code>. With parent rewriting, the resulting graph is:</p></div>
1988 <div class="listingblock">
1989 <div class="content">
1990 <pre><code> .-A---M--------N---O---P
1991 / / \ \ \/ / /
1992 I B \ R-'`--' /
1993 \ / \/ /
1994 \ / /\ /
1995 `---X--' `------'</code></pre>
1996 </div></div>
1997 <div class="paragraph"><p>Here, the merge commits <code>O</code> and <code>P</code> contribute extra noise, as they did
1998 not actually contribute a change to <code>file.txt</code>. They only merged a topic
1999 that was based on an older version of <code>file.txt</code>. This is a common
2000 issue in repositories using a workflow where many contributors work in
2001 parallel and merge their topic branches along a single trunk: many
2002 unrelated merges appear in the <code>--full-history</code> results.</p></div>
2003 <div class="paragraph"><p>When using the <code>--simplify-merges</code> option, the commits <code>O</code> and <code>P</code>
2004 disappear from the results. This is because the rewritten second parents
2005 of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are
2006 removed and then the commits look like single-parent commits that are
2007 TREESAME to their parent. This also happens to the commit <code>N</code>, resulting
2008 in a history view as follows:</p></div>
2009 <div class="listingblock">
2010 <div class="content">
2011 <pre><code> .-A---M--.
2012 / / \
2013 I B R
2014 \ / /
2015 \ / /
2016 `---X--'</code></pre>
2017 </div></div>
2018 <div class="paragraph"><p>In this view, we see all of the important single-parent changes from
2019 <code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the
2020 not-so-carefully-resolved merge <code>R</code>. This is usually enough information
2021 to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in
2022 the default view. However, there are a few issues with this approach.</p></div>
2023 <div class="paragraph"><p>The first issue is performance. Unlike any previous option, the
2024 <code>--simplify-merges</code> option requires walking the entire commit history
2025 before returning a single result. This can make the option difficult to
2026 use for very large repositories.</p></div>
2027 <div class="paragraph"><p>The second issue is one of auditing. When many contributors are working
2028 on the same repository, it is important which merge commits introduced
2029 a change into an important branch. The problematic merge <code>R</code> above is
2030 not likely to be the merge commit that was used to merge into an
2031 important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code>
2032 into the important branch. This commit may have information about why
2033 the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its
2034 commit message.</p></div>
2035 <div class="dlist"><dl>
2036 <dt class="hdlist1">
2037 --show-pulls
2038 </dt>
2039 <dd>
2041 In addition to the commits shown in the default history, show
2042 each merge commit that is not TREESAME to its first parent but
2043 is TREESAME to a later parent.
2044 </p>
2045 <div class="paragraph"><p>When a merge commit is included by <code>--show-pulls</code>, the merge is
2046 treated as if it "pulled" the change from another branch. When using
2047 <code>--show-pulls</code> on this example (and no other options) the resulting
2048 graph is:</p></div>
2049 <div class="listingblock">
2050 <div class="content">
2051 <pre><code> I---X---R---N</code></pre>
2052 </div></div>
2053 <div class="paragraph"><p>Here, the merge commits <code>R</code> and <code>N</code> are included because they pulled
2054 the commits <code>X</code> and <code>R</code> into the base branch, respectively. These
2055 merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the
2056 default history.</p></div>
2057 <div class="paragraph"><p>When <code>--show-pulls</code> is paired with <code>--simplify-merges</code>, the
2058 graph includes all of the necessary information:</p></div>
2059 <div class="listingblock">
2060 <div class="content">
2061 <pre><code> .-A---M--. N
2062 / / \ /
2063 I B R
2064 \ / /
2065 \ / /
2066 `---X--'</code></pre>
2067 </div></div>
2068 <div class="paragraph"><p>Notice that since <code>M</code> is reachable from <code>R</code>, the edge from <code>N</code> to <code>M</code>
2069 was simplified away. However, <code>N</code> still appears in the history as an
2070 important commit because it "pulled" the change <code>R</code> into the main
2071 branch.</p></div>
2072 </dd>
2073 </dl></div>
2074 <div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
2075 big picture of the topology of the history, by omitting commits
2076 that are not referenced by tags. Commits are marked as !TREESAME
2077 (in other words, kept after history simplification rules described
2078 above) if (1) they are referenced by tags, or (2) they change the
2079 contents of the paths given on the command line. All other
2080 commits are marked as TREESAME (subject to be simplified away).</p></div>
2081 </div>
2082 <div class="sect2">
2083 <h3 id="_commit_ordering">Commit Ordering</h3>
2084 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
2085 <div class="dlist"><dl>
2086 <dt class="hdlist1">
2087 --date-order
2088 </dt>
2089 <dd>
2091 Show no parents before all of its children are shown, but
2092 otherwise show commits in the commit timestamp order.
2093 </p>
2094 </dd>
2095 <dt class="hdlist1">
2096 --author-date-order
2097 </dt>
2098 <dd>
2100 Show no parents before all of its children are shown, but
2101 otherwise show commits in the author timestamp order.
2102 </p>
2103 </dd>
2104 <dt class="hdlist1">
2105 --topo-order
2106 </dt>
2107 <dd>
2109 Show no parents before all of its children are shown, and
2110 avoid showing commits on multiple lines of history
2111 intermixed.
2112 </p>
2113 <div class="paragraph"><p>For example, in a commit history like this:</p></div>
2114 <div class="listingblock">
2115 <div class="content">
2116 <pre><code> ---1----2----4----7
2118 3----5----6----8---</code></pre>
2119 </div></div>
2120 <div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
2121 rev-list</code> and friends with <code>--date-order</code> show the commits in the
2122 timestamp order: 8 7 6 5 4 3 2 1.</p></div>
2123 <div class="paragraph"><p>With <code>--topo-order</code>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5
2124 3 1); some older commits are shown before newer ones in order to
2125 avoid showing the commits from two parallel development track mixed
2126 together.</p></div>
2127 </dd>
2128 <dt class="hdlist1">
2129 --reverse
2130 </dt>
2131 <dd>
2133 Output the commits chosen to be shown (see Commit Limiting
2134 section above) in reverse order. Cannot be combined with
2135 <code>--walk-reflogs</code>.
2136 </p>
2137 </dd>
2138 </dl></div>
2139 </div>
2140 <div class="sect2">
2141 <h3 id="_object_traversal">Object Traversal</h3>
2142 <div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
2143 <div class="dlist"><dl>
2144 <dt class="hdlist1">
2145 --no-walk[=(sorted|unsorted)]
2146 </dt>
2147 <dd>
2149 Only show the given commits, but do not traverse their ancestors.
2150 This has no effect if a range is specified. If the argument
2151 <code>unsorted</code> is given, the commits are shown in the order they were
2152 given on the command line. Otherwise (if <code>sorted</code> or no argument
2153 was given), the commits are shown in reverse chronological order
2154 by commit time.
2155 Cannot be combined with <code>--graph</code>.
2156 </p>
2157 </dd>
2158 <dt class="hdlist1">
2159 --do-walk
2160 </dt>
2161 <dd>
2163 Overrides a previous <code>--no-walk</code>.
2164 </p>
2165 </dd>
2166 </dl></div>
2167 </div>
2168 <div class="sect2">
2169 <h3 id="_commit_formatting">Commit Formatting</h3>
2170 <div class="dlist"><dl>
2171 <dt class="hdlist1">
2172 --pretty[=&lt;format&gt;]
2173 </dt>
2174 <dt class="hdlist1">
2175 --format=&lt;format&gt;
2176 </dt>
2177 <dd>
2179 Pretty-print the contents of the commit logs in a given format,
2180 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
2181 <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
2182 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
2183 and has <em>%placeholder</em> in it, it acts as if
2184 <em>--pretty=tformat:&lt;format&gt;</em> were given.
2185 </p>
2186 <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
2187 format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
2188 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
2189 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
2190 </dd>
2191 <dt class="hdlist1">
2192 --abbrev-commit
2193 </dt>
2194 <dd>
2196 Instead of showing the full 40-byte hexadecimal commit object
2197 name, show a prefix that names the object uniquely.
2198 "--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
2199 option can be used to specify the minimum length of the prefix.
2200 </p>
2201 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
2202 people using 80-column terminals.</p></div>
2203 </dd>
2204 <dt class="hdlist1">
2205 --no-abbrev-commit
2206 </dt>
2207 <dd>
2209 Show the full 40-byte hexadecimal commit object name. This negates
2210 <code>--abbrev-commit</code>, either explicit or implied by other options such
2211 as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
2212 </p>
2213 </dd>
2214 <dt class="hdlist1">
2215 --oneline
2216 </dt>
2217 <dd>
2219 This is a shorthand for "--pretty=oneline --abbrev-commit"
2220 used together.
2221 </p>
2222 </dd>
2223 <dt class="hdlist1">
2224 --encoding=&lt;encoding&gt;
2225 </dt>
2226 <dd>
2228 Commit objects record the character encoding used for the log message
2229 in their encoding header; this option can be used to tell the
2230 command to re-code the commit log message in the encoding
2231 preferred by the user. For non plumbing commands this
2232 defaults to UTF-8. Note that if an object claims to be encoded
2233 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2234 verbatim; this means that invalid sequences in the original
2235 commit may be copied to the output. Likewise, if iconv(3) fails
2236 to convert the commit, we will quietly output the original
2237 object verbatim.
2238 </p>
2239 </dd>
2240 <dt class="hdlist1">
2241 --expand-tabs=&lt;n&gt;
2242 </dt>
2243 <dt class="hdlist1">
2244 --expand-tabs
2245 </dt>
2246 <dt class="hdlist1">
2247 --no-expand-tabs
2248 </dt>
2249 <dd>
2251 Perform a tab expansion (replace each tab with enough spaces
2252 to fill to the next display column that is a multiple of <em>&lt;n&gt;</em>)
2253 in the log message before showing it in the output.
2254 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2255 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2256 which disables tab expansion.
2257 </p>
2258 <div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2259 message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2260 and <em>fuller</em>).</p></div>
2261 </dd>
2262 <dt class="hdlist1">
2263 --notes[=&lt;ref&gt;]
2264 </dt>
2265 <dd>
2267 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
2268 commit, when showing the commit log message. This is the default
2269 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
2270 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
2271 on the command line.
2272 </p>
2273 <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
2274 <code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
2275 environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
2276 <div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, use the ref to find the notes
2277 to display. The ref can specify the full refname when it begins
2278 with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
2279 <code>refs/notes/</code> is prefixed to form the full name of the ref.</p></div>
2280 <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
2281 being displayed. Examples: "--notes=foo" will show only notes from
2282 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
2283 "refs/notes/foo" and from the default notes ref(s).</p></div>
2284 </dd>
2285 <dt class="hdlist1">
2286 --no-notes
2287 </dt>
2288 <dd>
2290 Do not show notes. This negates the above <code>--notes</code> option, by
2291 resetting the list of notes refs from which notes are shown.
2292 Options are parsed in the order given on the command line, so e.g.
2293 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2294 from "refs/notes/bar".
2295 </p>
2296 </dd>
2297 <dt class="hdlist1">
2298 --show-notes-by-default
2299 </dt>
2300 <dd>
2302 Show the default notes unless options for displaying specific
2303 notes are given.
2304 </p>
2305 </dd>
2306 <dt class="hdlist1">
2307 --show-notes[=&lt;ref&gt;]
2308 </dt>
2309 <dt class="hdlist1">
2310 --[no-]standard-notes
2311 </dt>
2312 <dd>
2314 These options are deprecated. Use the above --notes/--no-notes
2315 options instead.
2316 </p>
2317 </dd>
2318 <dt class="hdlist1">
2319 --show-signature
2320 </dt>
2321 <dd>
2323 Check the validity of a signed commit object by passing the signature
2324 to <code>gpg --verify</code> and show the output.
2325 </p>
2326 </dd>
2327 <dt class="hdlist1">
2328 --relative-date
2329 </dt>
2330 <dd>
2332 Synonym for <code>--date=relative</code>.
2333 </p>
2334 </dd>
2335 <dt class="hdlist1">
2336 --date=&lt;format&gt;
2337 </dt>
2338 <dd>
2340 Only takes effect for dates shown in human-readable format, such
2341 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
2342 value for the log command&#8217;s <code>--date</code> option. By default, dates
2343 are shown in the original time zone (either committer&#8217;s or
2344 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
2345 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
2346 </p>
2347 <div class="openblock">
2348 <div class="content">
2349 <div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
2350 e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option has no effect for
2351 <code>--date=relative</code>.</p></div>
2352 <div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div>
2353 <div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2354 The differences to the strict ISO 8601 format are:</p></div>
2355 <div class="ulist"><ul>
2356 <li>
2358 a space instead of the <code>T</code> date/time delimiter
2359 </p>
2360 </li>
2361 <li>
2363 a space between time and time zone
2364 </p>
2365 </li>
2366 <li>
2368 no colon between hours and minutes of the time zone
2369 </p>
2370 </li>
2371 </ul></div>
2372 <div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2373 ISO 8601 format.</p></div>
2374 <div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
2375 format, often found in email messages.</p></div>
2376 <div class="paragraph"><p><code>--date=short</code> shows only the date, but not the time, in <code>YYYY-MM-DD</code> format.</p></div>
2377 <div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
2378 00:00:00 UTC), followed by a space, and then the timezone as an offset
2379 from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2380 the second two are minutes). I.e., as if the timestamp were formatted
2381 with <code>strftime("%s %z")</code>).
2382 Note that the <code>-local</code> option does not affect the seconds-since-epoch
2383 value (which is always measured in UTC), but does switch the accompanying
2384 timezone value.</p></div>
2385 <div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the
2386 current time-zone, and doesn&#8217;t print the whole date if that matches
2387 (ie skip printing year for dates that are "this year", but also skip
2388 the whole date itself if it&#8217;s in the last few days and we can just say
2389 what weekday it was). For older dates the hour and minute is also
2390 omitted.</p></div>
2391 <div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
2392 1970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2393 has no effect.</p></div>
2394 <div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
2395 except for %s, %z, and %Z, which are handled internally.
2396 Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2397 preferred format. See the <code>strftime</code> manual for a complete list of
2398 format placeholders. When using <code>-local</code>, the correct syntax is
2399 <code>--date=format-local:...</code>.</p></div>
2400 <div class="paragraph"><p><code>--date=default</code> is the default format, and is based on ctime(3)
2401 output. It shows a single line with three-letter day of the week,
2402 three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS"
2403 format, followed by 4-digit year, plus timezone information, unless
2404 the local time zone is used, e.g. <code>Thu Jan 1 00:00:00 1970 +0000</code>.</p></div>
2405 </div></div>
2406 </dd>
2407 <dt class="hdlist1">
2408 --parents
2409 </dt>
2410 <dd>
2412 Print also the parents of the commit (in the form "commit parent&#8230;").
2413 Also enables parent rewriting, see <em>History Simplification</em> above.
2414 </p>
2415 </dd>
2416 <dt class="hdlist1">
2417 --children
2418 </dt>
2419 <dd>
2421 Print also the children of the commit (in the form "commit child&#8230;").
2422 Also enables parent rewriting, see <em>History Simplification</em> above.
2423 </p>
2424 </dd>
2425 <dt class="hdlist1">
2426 --left-right
2427 </dt>
2428 <dd>
2430 Mark which side of a symmetric difference a commit is reachable from.
2431 Commits from the left side are prefixed with <code>&lt;</code> and those from
2432 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2433 commits are prefixed with <code>-</code>.
2434 </p>
2435 <div class="paragraph"><p>For example, if you have this topology:</p></div>
2436 <div class="listingblock">
2437 <div class="content">
2438 <pre><code> y---b---b branch B
2439 / \ /
2441 / / \
2442 o---x---a---a branch A</code></pre>
2443 </div></div>
2444 <div class="paragraph"><p>you would get an output like this:</p></div>
2445 <div class="listingblock">
2446 <div class="content">
2447 <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
2449 &gt;bbbbbbb... 3rd on b
2450 &gt;bbbbbbb... 2nd on b
2451 &lt;aaaaaaa... 3rd on a
2452 &lt;aaaaaaa... 2nd on a
2453 -yyyyyyy... 1st on b
2454 -xxxxxxx... 1st on a</code></pre>
2455 </div></div>
2456 </dd>
2457 <dt class="hdlist1">
2458 --graph
2459 </dt>
2460 <dd>
2462 Draw a text-based graphical representation of the commit history
2463 on the left hand side of the output. This may cause extra lines
2464 to be printed in between commits, in order for the graph history
2465 to be drawn properly.
2466 Cannot be combined with <code>--no-walk</code>.
2467 </p>
2468 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
2469 <div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2470 <code>--date-order</code> option may also be specified.</p></div>
2471 </dd>
2472 <dt class="hdlist1">
2473 --show-linear-break[=&lt;barrier&gt;]
2474 </dt>
2475 <dd>
2477 When --graph is not used, all history branches are flattened
2478 which can make it hard to see that the two consecutive commits
2479 do not belong to a linear branch. This option puts a barrier
2480 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
2481 is the string that will be shown instead of the default one.
2482 </p>
2483 </dd>
2484 </dl></div>
2485 </div>
2486 </div>
2487 </div>
2488 <div class="sect1">
2489 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
2490 <div class="sectionbody">
2491 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
2492 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2493 inserted before the <em>Author:</em> line. This line begins with
2494 "Merge: " and the hashes of ancestral commits are printed,
2495 separated by spaces. Note that the listed commits may not
2496 necessarily be the list of the <strong>direct</strong> parent commits if you
2497 have limited your view of history: for example, if you are
2498 only interested in changes related to a certain directory or
2499 file.</p></div>
2500 <div class="paragraph"><p>There are several built-in formats, and you can define
2501 additional formats by setting a pretty.&lt;name&gt;
2502 config option to either another format name, or a
2503 <em>format:</em> string, as described below (see
2504 <a href="git-config.html">git-config(1)</a>). Here are the details of the
2505 built-in formats:</p></div>
2506 <div class="ulist"><ul>
2507 <li>
2509 <em>oneline</em>
2510 </p>
2511 <div class="literalblock">
2512 <div class="content">
2513 <pre><code>&lt;hash&gt; &lt;title-line&gt;</code></pre>
2514 </div></div>
2515 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
2516 </li>
2517 <li>
2519 <em>short</em>
2520 </p>
2521 <div class="literalblock">
2522 <div class="content">
2523 <pre><code>commit &lt;hash&gt;
2524 Author: &lt;author&gt;</code></pre>
2525 </div></div>
2526 <div class="literalblock">
2527 <div class="content">
2528 <pre><code>&lt;title-line&gt;</code></pre>
2529 </div></div>
2530 </li>
2531 <li>
2533 <em>medium</em>
2534 </p>
2535 <div class="literalblock">
2536 <div class="content">
2537 <pre><code>commit &lt;hash&gt;
2538 Author: &lt;author&gt;
2539 Date: &lt;author-date&gt;</code></pre>
2540 </div></div>
2541 <div class="literalblock">
2542 <div class="content">
2543 <pre><code>&lt;title-line&gt;</code></pre>
2544 </div></div>
2545 <div class="literalblock">
2546 <div class="content">
2547 <pre><code>&lt;full-commit-message&gt;</code></pre>
2548 </div></div>
2549 </li>
2550 <li>
2552 <em>full</em>
2553 </p>
2554 <div class="literalblock">
2555 <div class="content">
2556 <pre><code>commit &lt;hash&gt;
2557 Author: &lt;author&gt;
2558 Commit: &lt;committer&gt;</code></pre>
2559 </div></div>
2560 <div class="literalblock">
2561 <div class="content">
2562 <pre><code>&lt;title-line&gt;</code></pre>
2563 </div></div>
2564 <div class="literalblock">
2565 <div class="content">
2566 <pre><code>&lt;full-commit-message&gt;</code></pre>
2567 </div></div>
2568 </li>
2569 <li>
2571 <em>fuller</em>
2572 </p>
2573 <div class="literalblock">
2574 <div class="content">
2575 <pre><code>commit &lt;hash&gt;
2576 Author: &lt;author&gt;
2577 AuthorDate: &lt;author-date&gt;
2578 Commit: &lt;committer&gt;
2579 CommitDate: &lt;committer-date&gt;</code></pre>
2580 </div></div>
2581 <div class="literalblock">
2582 <div class="content">
2583 <pre><code>&lt;title-line&gt;</code></pre>
2584 </div></div>
2585 <div class="literalblock">
2586 <div class="content">
2587 <pre><code>&lt;full-commit-message&gt;</code></pre>
2588 </div></div>
2589 </li>
2590 <li>
2592 <em>reference</em>
2593 </p>
2594 <div class="literalblock">
2595 <div class="content">
2596 <pre><code>&lt;abbrev-hash&gt; (&lt;title-line&gt;, &lt;short-author-date&gt;)</code></pre>
2597 </div></div>
2598 <div class="paragraph"><p>This format is used to refer to another commit in a commit message and
2599 is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
2600 the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
2601 is explicitly specified. As with any <code>format:</code> with format
2602 placeholders, its output is not affected by other options like
2603 <code>--decorate</code> and <code>--walk-reflogs</code>.</p></div>
2604 </li>
2605 <li>
2607 <em>email</em>
2608 </p>
2609 <div class="literalblock">
2610 <div class="content">
2611 <pre><code>From &lt;hash&gt; &lt;date&gt;
2612 From: &lt;author&gt;
2613 Date: &lt;author-date&gt;
2614 Subject: [PATCH] &lt;title-line&gt;</code></pre>
2615 </div></div>
2616 <div class="literalblock">
2617 <div class="content">
2618 <pre><code>&lt;full-commit-message&gt;</code></pre>
2619 </div></div>
2620 </li>
2621 <li>
2623 <em>mboxrd</em>
2624 </p>
2625 <div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From "
2626 (preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
2627 confused as starting a new commit.</p></div>
2628 </li>
2629 <li>
2631 <em>raw</em>
2632 </p>
2633 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
2634 stored in the commit object. Notably, the hashes are
2635 displayed in full, regardless of whether --abbrev or
2636 --no-abbrev are used, and <em>parents</em> information show the
2637 true parent commits, without taking grafts or history
2638 simplification into account. Note that this format affects the way
2639 commits are displayed, but not the way the diff is shown e.g. with
2640 <code>git log --raw</code>. To get full object names in a raw diff format,
2641 use <code>--no-abbrev</code>.</p></div>
2642 </li>
2643 <li>
2645 <em>format:&lt;format-string&gt;</em>
2646 </p>
2647 <div class="paragraph"><p>The <em>format:&lt;format-string&gt;</em> format allows you to specify which information
2648 you want to show. It works a little bit like printf format,
2649 with the notable exception that you get a newline with <em>%n</em>
2650 instead of <em>\n</em>.</p></div>
2651 <div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
2652 would show something like this:</p></div>
2653 <div class="listingblock">
2654 <div class="content">
2655 <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2656 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</code></pre>
2657 </div></div>
2658 <div class="paragraph"><p>The placeholders are:</p></div>
2659 <div class="ulist"><ul>
2660 <li>
2662 Placeholders that expand to a single literal character:
2663 </p>
2664 <div class="dlist"><dl>
2665 <dt class="hdlist1">
2666 <em>%n</em>
2667 </dt>
2668 <dd>
2670 newline
2671 </p>
2672 </dd>
2673 <dt class="hdlist1">
2674 <em>%%</em>
2675 </dt>
2676 <dd>
2678 a raw <em>%</em>
2679 </p>
2680 </dd>
2681 <dt class="hdlist1">
2682 <em>%x00</em>
2683 </dt>
2684 <dd>
2686 <em>%x</em> followed by two hexadecimal digits is replaced with a
2687 byte with the hexadecimal digits' value (we will call this
2688 "literal formatting code" in the rest of this document).
2689 </p>
2690 </dd>
2691 </dl></div>
2692 </li>
2693 <li>
2695 Placeholders that affect formatting of later placeholders:
2696 </p>
2697 <div class="dlist"><dl>
2698 <dt class="hdlist1">
2699 <em>%Cred</em>
2700 </dt>
2701 <dd>
2703 switch color to red
2704 </p>
2705 </dd>
2706 <dt class="hdlist1">
2707 <em>%Cgreen</em>
2708 </dt>
2709 <dd>
2711 switch color to green
2712 </p>
2713 </dd>
2714 <dt class="hdlist1">
2715 <em>%Cblue</em>
2716 </dt>
2717 <dd>
2719 switch color to blue
2720 </p>
2721 </dd>
2722 <dt class="hdlist1">
2723 <em>%Creset</em>
2724 </dt>
2725 <dd>
2727 reset color
2728 </p>
2729 </dd>
2730 <dt class="hdlist1">
2731 <em>%C(&#8230;)</em>
2732 </dt>
2733 <dd>
2735 color specification, as described under Values in the
2736 "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
2737 default, colors are shown only when enabled for log output
2738 (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
2739 the <code>auto</code> settings of the former if we are going to a
2740 terminal). <code>%C(auto,...)</code> is accepted as a historical
2741 synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
2742 <code>%C(always,...)</code> will show the colors even when color is
2743 not otherwise enabled (though consider just using
2744 <code>--color=always</code> to enable color for the whole output,
2745 including this format and anything else git might color).
2746 <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2747 on the next placeholders until the color is switched
2748 again.
2749 </p>
2750 </dd>
2751 <dt class="hdlist1">
2752 <em>%m</em>
2753 </dt>
2754 <dd>
2756 left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark
2757 </p>
2758 </dd>
2759 <dt class="hdlist1">
2760 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>
2761 </dt>
2762 <dd>
2764 switch line wrapping, like the -w option of
2765 <a href="git-shortlog.html">git-shortlog(1)</a>.
2766 </p>
2767 </dd>
2768 <dt class="hdlist1">
2769 <em>%&lt;( &lt;N&gt; [,trunc|ltrunc|mtrunc])</em>
2770 </dt>
2771 <dd>
2773 make the next placeholder take at
2774 least N column widths, padding spaces on
2775 the right if necessary. Optionally
2776 truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..ft</code>,
2777 the middle (mtrunc) <code>mi..le</code>, or the end
2778 (trunc) <code>rig..</code>, if the output is longer than
2779 N columns.
2780 Note 1: that truncating
2781 only works correctly with N &gt;= 2.
2782 Note 2: spaces around the N and M (see below)
2783 values are optional.
2784 Note 3: Emojis and other wide characters
2785 will take two display columns, which may
2786 over-run column boundaries.
2787 Note 4: decomposed character combining marks
2788 may be misplaced at padding boundaries.
2789 </p>
2790 </dd>
2791 <dt class="hdlist1">
2792 <em>%&lt;|( &lt;M&gt; )</em>
2793 </dt>
2794 <dd>
2796 make the next placeholder take at least until Mth
2797 display column, padding spaces on the right if necessary.
2798 Use negative M values for column positions measured
2799 from the right hand edge of the terminal window.
2800 </p>
2801 </dd>
2802 <dt class="hdlist1">
2803 <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
2804 </dt>
2805 <dd>
2807 similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em> respectively,
2808 but padding spaces on the left
2809 </p>
2810 </dd>
2811 <dt class="hdlist1">
2812 <em>%&gt;&gt;( &lt;N&gt; )</em>, <em>%&gt;&gt;|( &lt;M&gt; )</em>
2813 </dt>
2814 <dd>
2816 similar to <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
2817 respectively, except that if the next
2818 placeholder takes more spaces than given and
2819 there are spaces on its left, use those
2820 spaces
2821 </p>
2822 </dd>
2823 <dt class="hdlist1">
2824 <em>%&gt;&lt;( &lt;N&gt; )</em>, <em>%&gt;&lt;|( &lt;M&gt; )</em>
2825 </dt>
2826 <dd>
2828 similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em>
2829 respectively, but padding both sides
2830 (i.e. the text is centered)
2831 </p>
2832 </dd>
2833 </dl></div>
2834 </li>
2835 <li>
2837 Placeholders that expand to information extracted from the commit:
2838 </p>
2839 <div class="dlist"><dl>
2840 <dt class="hdlist1">
2841 <em>%H</em>
2842 </dt>
2843 <dd>
2845 commit hash
2846 </p>
2847 </dd>
2848 <dt class="hdlist1">
2849 <em>%h</em>
2850 </dt>
2851 <dd>
2853 abbreviated commit hash
2854 </p>
2855 </dd>
2856 <dt class="hdlist1">
2857 <em>%T</em>
2858 </dt>
2859 <dd>
2861 tree hash
2862 </p>
2863 </dd>
2864 <dt class="hdlist1">
2865 <em>%t</em>
2866 </dt>
2867 <dd>
2869 abbreviated tree hash
2870 </p>
2871 </dd>
2872 <dt class="hdlist1">
2873 <em>%P</em>
2874 </dt>
2875 <dd>
2877 parent hashes
2878 </p>
2879 </dd>
2880 <dt class="hdlist1">
2881 <em>%p</em>
2882 </dt>
2883 <dd>
2885 abbreviated parent hashes
2886 </p>
2887 </dd>
2888 <dt class="hdlist1">
2889 <em>%an</em>
2890 </dt>
2891 <dd>
2893 author name
2894 </p>
2895 </dd>
2896 <dt class="hdlist1">
2897 <em>%aN</em>
2898 </dt>
2899 <dd>
2901 author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2902 or <a href="git-blame.html">git-blame(1)</a>)
2903 </p>
2904 </dd>
2905 <dt class="hdlist1">
2906 <em>%ae</em>
2907 </dt>
2908 <dd>
2910 author email
2911 </p>
2912 </dd>
2913 <dt class="hdlist1">
2914 <em>%aE</em>
2915 </dt>
2916 <dd>
2918 author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
2919 or <a href="git-blame.html">git-blame(1)</a>)
2920 </p>
2921 </dd>
2922 <dt class="hdlist1">
2923 <em>%al</em>
2924 </dt>
2925 <dd>
2927 author email local-part (the part before the <em>@</em> sign)
2928 </p>
2929 </dd>
2930 <dt class="hdlist1">
2931 <em>%aL</em>
2932 </dt>
2933 <dd>
2935 author local-part (see <em>%al</em>) respecting .mailmap, see
2936 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2937 </p>
2938 </dd>
2939 <dt class="hdlist1">
2940 <em>%ad</em>
2941 </dt>
2942 <dd>
2944 author date (format respects --date= option)
2945 </p>
2946 </dd>
2947 <dt class="hdlist1">
2948 <em>%aD</em>
2949 </dt>
2950 <dd>
2952 author date, RFC2822 style
2953 </p>
2954 </dd>
2955 <dt class="hdlist1">
2956 <em>%ar</em>
2957 </dt>
2958 <dd>
2960 author date, relative
2961 </p>
2962 </dd>
2963 <dt class="hdlist1">
2964 <em>%at</em>
2965 </dt>
2966 <dd>
2968 author date, UNIX timestamp
2969 </p>
2970 </dd>
2971 <dt class="hdlist1">
2972 <em>%ai</em>
2973 </dt>
2974 <dd>
2976 author date, ISO 8601-like format
2977 </p>
2978 </dd>
2979 <dt class="hdlist1">
2980 <em>%aI</em>
2981 </dt>
2982 <dd>
2984 author date, strict ISO 8601 format
2985 </p>
2986 </dd>
2987 <dt class="hdlist1">
2988 <em>%as</em>
2989 </dt>
2990 <dd>
2992 author date, short format (<code>YYYY-MM-DD</code>)
2993 </p>
2994 </dd>
2995 <dt class="hdlist1">
2996 <em>%ah</em>
2997 </dt>
2998 <dd>
3000 author date, human style (like the <code>--date=human</code> option of
3001 <a href="git-rev-list.html">git-rev-list(1)</a>)
3002 </p>
3003 </dd>
3004 <dt class="hdlist1">
3005 <em>%cn</em>
3006 </dt>
3007 <dd>
3009 committer name
3010 </p>
3011 </dd>
3012 <dt class="hdlist1">
3013 <em>%cN</em>
3014 </dt>
3015 <dd>
3017 committer name (respecting .mailmap, see
3018 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3019 </p>
3020 </dd>
3021 <dt class="hdlist1">
3022 <em>%ce</em>
3023 </dt>
3024 <dd>
3026 committer email
3027 </p>
3028 </dd>
3029 <dt class="hdlist1">
3030 <em>%cE</em>
3031 </dt>
3032 <dd>
3034 committer email (respecting .mailmap, see
3035 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3036 </p>
3037 </dd>
3038 <dt class="hdlist1">
3039 <em>%cl</em>
3040 </dt>
3041 <dd>
3043 committer email local-part (the part before the <em>@</em> sign)
3044 </p>
3045 </dd>
3046 <dt class="hdlist1">
3047 <em>%cL</em>
3048 </dt>
3049 <dd>
3051 committer local-part (see <em>%cl</em>) respecting .mailmap, see
3052 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3053 </p>
3054 </dd>
3055 <dt class="hdlist1">
3056 <em>%cd</em>
3057 </dt>
3058 <dd>
3060 committer date (format respects --date= option)
3061 </p>
3062 </dd>
3063 <dt class="hdlist1">
3064 <em>%cD</em>
3065 </dt>
3066 <dd>
3068 committer date, RFC2822 style
3069 </p>
3070 </dd>
3071 <dt class="hdlist1">
3072 <em>%cr</em>
3073 </dt>
3074 <dd>
3076 committer date, relative
3077 </p>
3078 </dd>
3079 <dt class="hdlist1">
3080 <em>%ct</em>
3081 </dt>
3082 <dd>
3084 committer date, UNIX timestamp
3085 </p>
3086 </dd>
3087 <dt class="hdlist1">
3088 <em>%ci</em>
3089 </dt>
3090 <dd>
3092 committer date, ISO 8601-like format
3093 </p>
3094 </dd>
3095 <dt class="hdlist1">
3096 <em>%cI</em>
3097 </dt>
3098 <dd>
3100 committer date, strict ISO 8601 format
3101 </p>
3102 </dd>
3103 <dt class="hdlist1">
3104 <em>%cs</em>
3105 </dt>
3106 <dd>
3108 committer date, short format (<code>YYYY-MM-DD</code>)
3109 </p>
3110 </dd>
3111 <dt class="hdlist1">
3112 <em>%ch</em>
3113 </dt>
3114 <dd>
3116 committer date, human style (like the <code>--date=human</code> option of
3117 <a href="git-rev-list.html">git-rev-list(1)</a>)
3118 </p>
3119 </dd>
3120 <dt class="hdlist1">
3121 <em>%d</em>
3122 </dt>
3123 <dd>
3125 ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
3126 </p>
3127 </dd>
3128 <dt class="hdlist1">
3129 <em>%D</em>
3130 </dt>
3131 <dd>
3133 ref names without the " (", ")" wrapping.
3134 </p>
3135 </dd>
3136 <dt class="hdlist1">
3137 <em>%(decorate[:&lt;options&gt;])</em>
3138 </dt>
3139 <dd>
3141 ref names with custom decorations. The <code>decorate</code> string may be followed by a
3142 colon and zero or more comma-separated options. Option values may contain
3143 literal formatting codes. These must be used for commas (<code>%x2C</code>) and closing
3144 parentheses (<code>%x29</code>), due to their role in the option syntax.
3145 </p>
3146 <div class="ulist"><ul>
3147 <li>
3149 <em>prefix=&lt;value&gt;</em>: Shown before the list of ref names. Defaults to "&#160;<code>(</code>".
3150 </p>
3151 </li>
3152 <li>
3154 <em>suffix=&lt;value&gt;</em>: Shown after the list of ref names. Defaults to "<code>)</code>".
3155 </p>
3156 </li>
3157 <li>
3159 <em>separator=&lt;value&gt;</em>: Shown between ref names. Defaults to "<code>,</code>&#160;".
3160 </p>
3161 </li>
3162 <li>
3164 <em>pointer=&lt;value&gt;</em>: Shown between HEAD and the branch it points to, if any.
3165 Defaults to "&#160;<code>-&gt;</code>&#160;".
3166 </p>
3167 </li>
3168 <li>
3170 <em>tag=&lt;value&gt;</em>: Shown before tag names. Defaults to "<code>tag:</code>&#160;".
3171 </p>
3172 </li>
3173 </ul></div>
3174 <div class="paragraph"><p>For example, to produce decorations with no wrapping
3175 or tag annotations, and spaces as separators:</p></div>
3176 <div class="paragraph"><p><code>%(decorate:prefix=,suffix=,tag=,separator= )</code></p></div>
3177 </dd>
3178 <dt class="hdlist1">
3179 <em>%(describe[:&lt;options&gt;])</em>
3180 </dt>
3181 <dd>
3183 human-readable name, like <a href="git-describe.html">git-describe(1)</a>; empty string for
3184 undescribable commits. The <code>describe</code> string may be followed by a colon and
3185 zero or more comma-separated options. Descriptions can be inconsistent when
3186 tags are added or removed at the same time.
3187 </p>
3188 <div class="ulist"><ul>
3189 <li>
3191 <em>tags[=&lt;bool-value&gt;]</em>: Instead of only considering annotated tags,
3192 consider lightweight tags as well.
3193 </p>
3194 </li>
3195 <li>
3197 <em>abbrev=&lt;number&gt;</em>: Instead of using the default number of hexadecimal digits
3198 (which will vary according to the number of objects in the repository with a
3199 default of 7) of the abbreviated object name, use &lt;number&gt; digits, or as many
3200 digits as needed to form a unique object name.
3201 </p>
3202 </li>
3203 <li>
3205 <em>match=&lt;pattern&gt;</em>: Only consider tags matching the given
3206 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3207 </p>
3208 </li>
3209 <li>
3211 <em>exclude=&lt;pattern&gt;</em>: Do not consider tags matching the given
3212 <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.
3213 </p>
3214 </li>
3215 </ul></div>
3216 </dd>
3217 <dt class="hdlist1">
3218 <em>%S</em>
3219 </dt>
3220 <dd>
3222 ref name given on the command line by which the commit was reached
3223 (like <code>git log --source</code>), only works with <code>git log</code>
3224 </p>
3225 </dd>
3226 <dt class="hdlist1">
3227 <em>%e</em>
3228 </dt>
3229 <dd>
3231 encoding
3232 </p>
3233 </dd>
3234 <dt class="hdlist1">
3235 <em>%s</em>
3236 </dt>
3237 <dd>
3239 subject
3240 </p>
3241 </dd>
3242 <dt class="hdlist1">
3243 <em>%f</em>
3244 </dt>
3245 <dd>
3247 sanitized subject line, suitable for a filename
3248 </p>
3249 </dd>
3250 <dt class="hdlist1">
3251 <em>%b</em>
3252 </dt>
3253 <dd>
3255 body
3256 </p>
3257 </dd>
3258 <dt class="hdlist1">
3259 <em>%B</em>
3260 </dt>
3261 <dd>
3263 raw body (unwrapped subject and body)
3264 </p>
3265 </dd>
3266 <dt class="hdlist1">
3267 <em>%N</em>
3268 </dt>
3269 <dd>
3271 commit notes
3272 </p>
3273 </dd>
3274 <dt class="hdlist1">
3275 <em>%GG</em>
3276 </dt>
3277 <dd>
3279 raw verification message from GPG for a signed commit
3280 </p>
3281 </dd>
3282 <dt class="hdlist1">
3283 <em>%G?</em>
3284 </dt>
3285 <dd>
3287 show "G" for a good (valid) signature,
3288 "B" for a bad signature,
3289 "U" for a good signature with unknown validity,
3290 "X" for a good signature that has expired,
3291 "Y" for a good signature made by an expired key,
3292 "R" for a good signature made by a revoked key,
3293 "E" if the signature cannot be checked (e.g. missing key)
3294 and "N" for no signature
3295 </p>
3296 </dd>
3297 <dt class="hdlist1">
3298 <em>%GS</em>
3299 </dt>
3300 <dd>
3302 show the name of the signer for a signed commit
3303 </p>
3304 </dd>
3305 <dt class="hdlist1">
3306 <em>%GK</em>
3307 </dt>
3308 <dd>
3310 show the key used to sign a signed commit
3311 </p>
3312 </dd>
3313 <dt class="hdlist1">
3314 <em>%GF</em>
3315 </dt>
3316 <dd>
3318 show the fingerprint of the key used to sign a signed commit
3319 </p>
3320 </dd>
3321 <dt class="hdlist1">
3322 <em>%GP</em>
3323 </dt>
3324 <dd>
3326 show the fingerprint of the primary key whose subkey was used
3327 to sign a signed commit
3328 </p>
3329 </dd>
3330 <dt class="hdlist1">
3331 <em>%GT</em>
3332 </dt>
3333 <dd>
3335 show the trust level for the key used to sign a signed commit
3336 </p>
3337 </dd>
3338 <dt class="hdlist1">
3339 <em>%gD</em>
3340 </dt>
3341 <dd>
3343 reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
3344 minutes ago}</code>; the format follows the rules described for the
3345 <code>-g</code> option. The portion before the <code>@</code> is the refname as
3346 given on the command line (so <code>git log -g refs/heads/master</code>
3347 would yield <code>refs/heads/master@{0}</code>).
3348 </p>
3349 </dd>
3350 <dt class="hdlist1">
3351 <em>%gd</em>
3352 </dt>
3353 <dd>
3355 shortened reflog selector; same as <code>%gD</code>, but the refname
3356 portion is shortened for human readability (so
3357 <code>refs/heads/master</code> becomes just <code>master</code>).
3358 </p>
3359 </dd>
3360 <dt class="hdlist1">
3361 <em>%gn</em>
3362 </dt>
3363 <dd>
3365 reflog identity name
3366 </p>
3367 </dd>
3368 <dt class="hdlist1">
3369 <em>%gN</em>
3370 </dt>
3371 <dd>
3373 reflog identity name (respecting .mailmap, see
3374 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3375 </p>
3376 </dd>
3377 <dt class="hdlist1">
3378 <em>%ge</em>
3379 </dt>
3380 <dd>
3382 reflog identity email
3383 </p>
3384 </dd>
3385 <dt class="hdlist1">
3386 <em>%gE</em>
3387 </dt>
3388 <dd>
3390 reflog identity email (respecting .mailmap, see
3391 <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
3392 </p>
3393 </dd>
3394 <dt class="hdlist1">
3395 <em>%gs</em>
3396 </dt>
3397 <dd>
3399 reflog subject
3400 </p>
3401 </dd>
3402 <dt class="hdlist1">
3403 <em>%(trailers[:&lt;options&gt;])</em>
3404 </dt>
3405 <dd>
3407 display the trailers of the body as interpreted by
3408 <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be followed by
3409 a colon and zero or more comma-separated options. If any option is provided
3410 multiple times, the last occurrence wins.
3411 </p>
3412 <div class="ulist"><ul>
3413 <li>
3415 <em>key=&lt;key&gt;</em>: only show trailers with specified &lt;key&gt;. Matching is done
3416 case-insensitively and trailing colon is optional. If option is
3417 given multiple times trailer lines matching any of the keys are
3418 shown. This option automatically enables the <code>only</code> option so that
3419 non-trailer lines in the trailer block are hidden. If that is not
3420 desired it can be disabled with <code>only=false</code>. E.g.,
3421 <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
3422 <code>Reviewed-by</code>.
3423 </p>
3424 </li>
3425 <li>
3427 <em>only[=&lt;bool&gt;]</em>: select whether non-trailer lines from the trailer
3428 block should be included.
3429 </p>
3430 </li>
3431 <li>
3433 <em>separator=&lt;sep&gt;</em>: specify the separator inserted between trailer
3434 lines. Defaults to a line feed character. The string &lt;sep&gt; may contain
3435 the literal formatting codes described above. To use comma as
3436 separator one must use <code>%x2C</code> as it would otherwise be parsed as
3437 next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
3438 shows all trailer lines whose key is "Ticket" separated by a comma
3439 and a space.
3440 </p>
3441 </li>
3442 <li>
3444 <em>unfold[=&lt;bool&gt;]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
3445 option was given. E.g.,
3446 <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.
3447 </p>
3448 </li>
3449 <li>
3451 <em>keyonly[=&lt;bool&gt;]</em>: only show the key part of the trailer.
3452 </p>
3453 </li>
3454 <li>
3456 <em>valueonly[=&lt;bool&gt;]</em>: only show the value part of the trailer.
3457 </p>
3458 </li>
3459 <li>
3461 <em>key_value_separator=&lt;sep&gt;</em>: specify the separator inserted between
3462 the key and value of each trailer. Defaults to ": ". Otherwise it
3463 shares the same semantics as <em>separator=&lt;sep&gt;</em> above.
3464 </p>
3465 </li>
3466 </ul></div>
3467 </dd>
3468 </dl></div>
3469 </li>
3470 </ul></div>
3471 </li>
3472 </ul></div>
3473 <div class="admonitionblock">
3474 <table><tr>
3475 <td class="icon">
3476 <div class="title">Note</div>
3477 </td>
3478 <td class="content">Some placeholders may depend on other options given to the
3479 revision traversal engine. For example, the <code>%g*</code> reflog options will
3480 insert an empty string unless we are traversing reflog entries (e.g., by
3481 <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
3482 decoration format if <code>--decorate</code> was not already provided on the command
3483 line.</td>
3484 </tr></table>
3485 </div>
3486 <div class="paragraph"><p>The boolean options accept an optional value <code>[=&lt;bool-value&gt;]</code>. The values
3487 <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean"
3488 sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean
3489 option is given with no value, it&#8217;s enabled.</p></div>
3490 <div class="paragraph"><p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
3491 is inserted immediately before the expansion if and only if the
3492 placeholder expands to a non-empty string.</p></div>
3493 <div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
3494 line-feeds immediately preceding the expansion are deleted if and only if the
3495 placeholder expands to an empty string.</p></div>
3496 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
3497 is inserted immediately before the expansion if and only if the
3498 placeholder expands to a non-empty string.</p></div>
3499 <div class="ulist"><ul>
3500 <li>
3502 <em>tformat:</em>
3503 </p>
3504 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
3505 provides "terminator" semantics instead of "separator" semantics. In
3506 other words, each commit has the message terminator character (usually a
3507 newline) appended, rather than a separator placed between entries.
3508 This means that the final entry of a single-line format will be properly
3509 terminated with a new line, just as the "oneline" format does.
3510 For example:</p></div>
3511 <div class="listingblock">
3512 <div class="content">
3513 <pre><code>$ git log -2 --pretty=format:%h 4da45bef \
3514 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
3515 4da45be
3516 7134973 -- NO NEWLINE
3518 $ git log -2 --pretty=tformat:%h 4da45bef \
3519 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
3520 4da45be
3521 7134973</code></pre>
3522 </div></div>
3523 <div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
3524 as if it has <code>tformat:</code> in front of it. For example, these two are
3525 equivalent:</p></div>
3526 <div class="listingblock">
3527 <div class="content">
3528 <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
3529 $ git log -2 --pretty=%h 4da45bef</code></pre>
3530 </div></div>
3531 </li>
3532 </ul></div>
3533 </div>
3534 </div>
3535 <div class="sect1">
3536 <h2 id="_diff_formatting">DIFF FORMATTING</h2>
3537 <div class="sectionbody">
3538 <div class="paragraph"><p>By default, <code>git log</code> does not generate any diff output. The options
3539 below can be used to show the changes made by each commit.</p></div>
3540 <div class="paragraph"><p>Note that unless one of <code>--diff-merges</code> variants (including short
3541 <code>-m</code>, <code>-c</code>, <code>--cc</code>, and <code>--dd</code> options) is explicitly given, merge commits
3542 will not show a diff, even if a diff format like <code>--patch</code> is
3543 selected, nor will they match search options like <code>-S</code>. The exception
3544 is when <code>--first-parent</code> is in use, in which case <code>first-parent</code> is
3545 the default format for merge commits.</p></div>
3546 <div class="dlist"><dl>
3547 <dt class="hdlist1">
3549 </dt>
3550 <dt class="hdlist1">
3552 </dt>
3553 <dt class="hdlist1">
3554 --patch
3555 </dt>
3556 <dd>
3558 Generate patch (see <a href="#generate_patch_text_with_p">[generate_patch_text_with_p]</a>).
3559 </p>
3560 </dd>
3561 <dt class="hdlist1">
3563 </dt>
3564 <dt class="hdlist1">
3565 --no-patch
3566 </dt>
3567 <dd>
3569 Suppress all output from the diff machinery. Useful for
3570 commands like <code>git show</code> that show the patch by default to
3571 squelch their output, or to cancel the effect of options like
3572 <code>--patch</code>, <code>--stat</code> earlier on the command line in an alias.
3573 </p>
3574 </dd>
3575 <dt class="hdlist1">
3577 </dt>
3578 <dd>
3580 Show diffs for merge commits in the default format. This is
3581 similar to <em>--diff-merges=on</em>, except <code>-m</code> will
3582 produce no output unless <code>-p</code> is given as well.
3583 </p>
3584 </dd>
3585 <dt class="hdlist1">
3587 </dt>
3588 <dd>
3590 Produce combined diff output for merge commits.
3591 Shortcut for <em>--diff-merges=combined -p</em>.
3592 </p>
3593 </dd>
3594 <dt class="hdlist1">
3595 --cc
3596 </dt>
3597 <dd>
3599 Produce dense combined diff output for merge commits.
3600 Shortcut for <em>--diff-merges=dense-combined -p</em>.
3601 </p>
3602 </dd>
3603 <dt class="hdlist1">
3604 --dd
3605 </dt>
3606 <dd>
3608 Produce diff with respect to first parent for both merge and
3609 regular commits.
3610 Shortcut for <em>--diff-merges=first-parent -p</em>.
3611 </p>
3612 </dd>
3613 <dt class="hdlist1">
3614 --remerge-diff
3615 </dt>
3616 <dd>
3618 Produce remerge-diff output for merge commits.
3619 Shortcut for <em>--diff-merges=remerge -p</em>.
3620 </p>
3621 </dd>
3622 <dt class="hdlist1">
3623 --no-diff-merges
3624 </dt>
3625 <dd>
3627 Synonym for <em>--diff-merges=off</em>.
3628 </p>
3629 </dd>
3630 <dt class="hdlist1">
3631 --diff-merges=&lt;format&gt;
3632 </dt>
3633 <dd>
3635 Specify diff format to be used for merge commits. Default is
3636 <code>off</code> unless <code>--first-parent</code> is in use, in
3637 which case <code>first-parent</code> is the default.
3638 </p>
3639 <div class="paragraph"><p>The following formats are supported:</p></div>
3640 <div class="openblock">
3641 <div class="content">
3642 <div class="dlist"><dl>
3643 <dt class="hdlist1">
3644 off, none
3645 </dt>
3646 <dd>
3648 Disable output of diffs for merge commits. Useful to override
3649 implied value.
3650 </p>
3651 </dd>
3652 <dt class="hdlist1">
3653 on, m
3654 </dt>
3655 <dd>
3657 Make diff output for merge commits to be shown in the default
3658 format. The default format can be changed using
3659 <code>log.diffMerges</code> configuration variable, whose default value
3660 is <code>separate</code>.
3661 </p>
3662 </dd>
3663 <dt class="hdlist1">
3664 first-parent, 1
3665 </dt>
3666 <dd>
3668 Show full diff with respect to first parent. This is the same
3669 format as <code>--patch</code> produces for non-merge commits.
3670 </p>
3671 </dd>
3672 <dt class="hdlist1">
3673 separate
3674 </dt>
3675 <dd>
3677 Show full diff with respect to each of parents.
3678 Separate log entry and diff is generated for each parent.
3679 </p>
3680 </dd>
3681 <dt class="hdlist1">
3682 combined, c
3683 </dt>
3684 <dd>
3686 Show differences from each of the parents to the merge
3687 result simultaneously instead of showing pairwise diff between
3688 a parent and the result one at a time. Furthermore, it lists
3689 only files which were modified from all parents.
3690 </p>
3691 </dd>
3692 <dt class="hdlist1">
3693 dense-combined, cc
3694 </dt>
3695 <dd>
3697 Further compress output produced by <code>--diff-merges=combined</code>
3698 by omitting uninteresting hunks whose contents in the parents
3699 have only two variants and the merge result picks one of them
3700 without modification.
3701 </p>
3702 </dd>
3703 <dt class="hdlist1">
3704 remerge, r
3705 </dt>
3706 <dd>
3708 Remerge two-parent merge commits to create a temporary tree
3709 object&#8212;potentially containing files with conflict markers
3710 and such. A diff is then shown between that temporary tree
3711 and the actual merge commit.
3712 </p>
3713 <div class="paragraph"><p>The output emitted when this option is used is subject to change, and
3714 so is its interaction with other options (unless explicitly
3715 documented).</p></div>
3716 </dd>
3717 </dl></div>
3718 </div></div>
3719 </dd>
3720 <dt class="hdlist1">
3721 --combined-all-paths
3722 </dt>
3723 <dd>
3725 This flag causes combined diffs (used for merge commits) to
3726 list the name of the file from all parents. It thus only has
3727 effect when <code>--diff-merges=[dense-]combined</code> is in use, and
3728 is likely only useful if filename changes are detected (i.e.
3729 when either rename or copy detection have been requested).
3730 </p>
3731 </dd>
3732 <dt class="hdlist1">
3733 -U&lt;n&gt;
3734 </dt>
3735 <dt class="hdlist1">
3736 --unified=&lt;n&gt;
3737 </dt>
3738 <dd>
3740 Generate diffs with &lt;n&gt; lines of context instead of
3741 the usual three.
3742 Implies <code>--patch</code>.
3743 </p>
3744 </dd>
3745 <dt class="hdlist1">
3746 --output=&lt;file&gt;
3747 </dt>
3748 <dd>
3750 Output to a specific file instead of stdout.
3751 </p>
3752 </dd>
3753 <dt class="hdlist1">
3754 --output-indicator-new=&lt;char&gt;
3755 </dt>
3756 <dt class="hdlist1">
3757 --output-indicator-old=&lt;char&gt;
3758 </dt>
3759 <dt class="hdlist1">
3760 --output-indicator-context=&lt;char&gt;
3761 </dt>
3762 <dd>
3764 Specify the character used to indicate new, old or context
3765 lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and
3766 ' ' respectively.
3767 </p>
3768 </dd>
3769 <dt class="hdlist1">
3770 --raw
3771 </dt>
3772 <dd>
3774 For each commit, show a summary of changes using the raw diff
3775 format. See the "RAW OUTPUT FORMAT" section of
3776 <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log
3777 itself in raw format, which you can achieve with
3778 <code>--format=raw</code>.
3779 </p>
3780 </dd>
3781 <dt class="hdlist1">
3782 --patch-with-raw
3783 </dt>
3784 <dd>
3786 Synonym for <code>-p --raw</code>.
3787 </p>
3788 </dd>
3789 <dt class="hdlist1">
3791 </dt>
3792 <dd>
3794 Show the tree objects in the diff output.
3795 </p>
3796 </dd>
3797 <dt class="hdlist1">
3798 --indent-heuristic
3799 </dt>
3800 <dd>
3802 Enable the heuristic that shifts diff hunk boundaries to make patches
3803 easier to read. This is the default.
3804 </p>
3805 </dd>
3806 <dt class="hdlist1">
3807 --no-indent-heuristic
3808 </dt>
3809 <dd>
3811 Disable the indent heuristic.
3812 </p>
3813 </dd>
3814 <dt class="hdlist1">
3815 --minimal
3816 </dt>
3817 <dd>
3819 Spend extra time to make sure the smallest possible
3820 diff is produced.
3821 </p>
3822 </dd>
3823 <dt class="hdlist1">
3824 --patience
3825 </dt>
3826 <dd>
3828 Generate a diff using the "patience diff" algorithm.
3829 </p>
3830 </dd>
3831 <dt class="hdlist1">
3832 --histogram
3833 </dt>
3834 <dd>
3836 Generate a diff using the "histogram diff" algorithm.
3837 </p>
3838 </dd>
3839 <dt class="hdlist1">
3840 --anchored=&lt;text&gt;
3841 </dt>
3842 <dd>
3844 Generate a diff using the "anchored diff" algorithm.
3845 </p>
3846 <div class="paragraph"><p>This option may be specified more than once.</p></div>
3847 <div class="paragraph"><p>If a line exists in both the source and destination, exists only once,
3848 and starts with this text, this algorithm attempts to prevent it from
3849 appearing as a deletion or addition in the output. It uses the "patience
3850 diff" algorithm internally.</p></div>
3851 </dd>
3852 <dt class="hdlist1">
3853 --diff-algorithm={patience|minimal|histogram|myers}
3854 </dt>
3855 <dd>
3857 Choose a diff algorithm. The variants are as follows:
3858 </p>
3859 <div class="openblock">
3860 <div class="content">
3861 <div class="dlist"><dl>
3862 <dt class="hdlist1">
3863 <code>default</code>, <code>myers</code>
3864 </dt>
3865 <dd>
3867 The basic greedy diff algorithm. Currently, this is the default.
3868 </p>
3869 </dd>
3870 <dt class="hdlist1">
3871 <code>minimal</code>
3872 </dt>
3873 <dd>
3875 Spend extra time to make sure the smallest possible diff is
3876 produced.
3877 </p>
3878 </dd>
3879 <dt class="hdlist1">
3880 <code>patience</code>
3881 </dt>
3882 <dd>
3884 Use "patience diff" algorithm when generating patches.
3885 </p>
3886 </dd>
3887 <dt class="hdlist1">
3888 <code>histogram</code>
3889 </dt>
3890 <dd>
3892 This algorithm extends the patience algorithm to "support
3893 low-occurrence common elements".
3894 </p>
3895 </dd>
3896 </dl></div>
3897 </div></div>
3898 <div class="paragraph"><p>For instance, if you configured the <code>diff.algorithm</code> variable to a
3899 non-default value and want to use the default one, then you
3900 have to use <code>--diff-algorithm=default</code> option.</p></div>
3901 </dd>
3902 <dt class="hdlist1">
3903 --stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
3904 </dt>
3905 <dd>
3907 Generate a diffstat. By default, as much space as necessary
3908 will be used for the filename part, and the rest for the graph
3909 part. Maximum width defaults to terminal width, or 80 columns
3910 if not connected to a terminal, and can be overridden by
3911 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
3912 giving another width <code>&lt;name-width&gt;</code> after a comma or by setting
3913 <code>diff.statNameWidth=&lt;width&gt;</code>. The width of the graph part can be
3914 limited by using <code>--stat-graph-width=&lt;width&gt;</code> or by setting
3915 <code>diff.statGraphWidth=&lt;width&gt;</code>. Using <code>--stat</code> or
3916 <code>--stat-graph-width</code> affects all commands generating a stat graph,
3917 while setting <code>diff.statNameWidth</code> or <code>diff.statGraphWidth</code>
3918 does not affect <code>git format-patch</code>.
3919 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the output to
3920 the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if there are more.
3921 </p>
3922 <div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
3923 <code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p></div>
3924 </dd>
3925 <dt class="hdlist1">
3926 --compact-summary
3927 </dt>
3928 <dd>
3930 Output a condensed summary of extended header information such
3931 as file creations or deletions ("new" or "gone", optionally "+l"
3932 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
3933 or removing executable bit respectively) in diffstat. The
3934 information is put between the filename part and the graph
3935 part. Implies <code>--stat</code>.
3936 </p>
3937 </dd>
3938 <dt class="hdlist1">
3939 --numstat
3940 </dt>
3941 <dd>
3943 Similar to <code>--stat</code>, but shows number of added and
3944 deleted lines in decimal notation and pathname without
3945 abbreviation, to make it more machine friendly. For
3946 binary files, outputs two <code>-</code> instead of saying
3947 <code>0 0</code>.
3948 </p>
3949 </dd>
3950 <dt class="hdlist1">
3951 --shortstat
3952 </dt>
3953 <dd>
3955 Output only the last line of the <code>--stat</code> format containing total
3956 number of modified files, as well as number of added and deleted
3957 lines.
3958 </p>
3959 </dd>
3960 <dt class="hdlist1">
3961 -X[&lt;param1,param2,&#8230;&gt;]
3962 </dt>
3963 <dt class="hdlist1">
3964 --dirstat[=&lt;param1,param2,&#8230;&gt;]
3965 </dt>
3966 <dd>
3968 Output the distribution of relative amount of changes for each
3969 sub-directory. The behavior of <code>--dirstat</code> can be customized by
3970 passing it a comma separated list of parameters.
3971 The defaults are controlled by the <code>diff.dirstat</code> configuration
3972 variable (see <a href="git-config.html">git-config(1)</a>).
3973 The following parameters are available:
3974 </p>
3975 <div class="openblock">
3976 <div class="content">
3977 <div class="dlist"><dl>
3978 <dt class="hdlist1">
3979 <code>changes</code>
3980 </dt>
3981 <dd>
3983 Compute the dirstat numbers by counting the lines that have been
3984 removed from the source, or added to the destination. This ignores
3985 the amount of pure code movements within a file. In other words,
3986 rearranging lines in a file is not counted as much as other changes.
3987 This is the default behavior when no parameter is given.
3988 </p>
3989 </dd>
3990 <dt class="hdlist1">
3991 <code>lines</code>
3992 </dt>
3993 <dd>
3995 Compute the dirstat numbers by doing the regular line-based diff
3996 analysis, and summing the removed/added line counts. (For binary
3997 files, count 64-byte chunks instead, since binary files have no
3998 natural concept of lines). This is a more expensive <code>--dirstat</code>
3999 behavior than the <code>changes</code> behavior, but it does count rearranged
4000 lines within a file as much as other changes. The resulting output
4001 is consistent with what you get from the other <code>--*stat</code> options.
4002 </p>
4003 </dd>
4004 <dt class="hdlist1">
4005 <code>files</code>
4006 </dt>
4007 <dd>
4009 Compute the dirstat numbers by counting the number of files changed.
4010 Each changed file counts equally in the dirstat analysis. This is
4011 the computationally cheapest <code>--dirstat</code> behavior, since it does
4012 not have to look at the file contents at all.
4013 </p>
4014 </dd>
4015 <dt class="hdlist1">
4016 <code>cumulative</code>
4017 </dt>
4018 <dd>
4020 Count changes in a child directory for the parent directory as well.
4021 Note that when using <code>cumulative</code>, the sum of the percentages
4022 reported may exceed 100%. The default (non-cumulative) behavior can
4023 be specified with the <code>noncumulative</code> parameter.
4024 </p>
4025 </dd>
4026 <dt class="hdlist1">
4027 &lt;limit&gt;
4028 </dt>
4029 <dd>
4031 An integer parameter specifies a cut-off percent (3% by default).
4032 Directories contributing less than this percentage of the changes
4033 are not shown in the output.
4034 </p>
4035 </dd>
4036 </dl></div>
4037 </div></div>
4038 <div class="paragraph"><p>Example: The following will count changed files, while ignoring
4039 directories with less than 10% of the total amount of changed files,
4040 and accumulating child directory counts in the parent directories:
4041 <code>--dirstat=files,10,cumulative</code>.</p></div>
4042 </dd>
4043 <dt class="hdlist1">
4044 --cumulative
4045 </dt>
4046 <dd>
4048 Synonym for --dirstat=cumulative
4049 </p>
4050 </dd>
4051 <dt class="hdlist1">
4052 --dirstat-by-file[=&lt;param1,param2&gt;&#8230;]
4053 </dt>
4054 <dd>
4056 Synonym for --dirstat=files,&lt;param1&gt;,&lt;param2&gt;&#8230;
4057 </p>
4058 </dd>
4059 <dt class="hdlist1">
4060 --summary
4061 </dt>
4062 <dd>
4064 Output a condensed summary of extended header information
4065 such as creations, renames and mode changes.
4066 </p>
4067 </dd>
4068 <dt class="hdlist1">
4069 --patch-with-stat
4070 </dt>
4071 <dd>
4073 Synonym for <code>-p --stat</code>.
4074 </p>
4075 </dd>
4076 <dt class="hdlist1">
4078 </dt>
4079 <dd>
4081 Separate the commits with NULs instead of newlines.
4082 </p>
4083 <div class="paragraph"><p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge
4084 pathnames and use NULs as output field terminators.</p></div>
4085 <div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as
4086 explained for the configuration variable <code>core.quotePath</code> (see
4087 <a href="git-config.html">git-config(1)</a>).</p></div>
4088 </dd>
4089 <dt class="hdlist1">
4090 --name-only
4091 </dt>
4092 <dd>
4094 Show only names of changed files. The file names are often encoded in UTF-8.
4095 For more information see the discussion about encoding in the <a href="git-log.html">git-log(1)</a>
4096 manual page.
4097 </p>
4098 </dd>
4099 <dt class="hdlist1">
4100 --name-status
4101 </dt>
4102 <dd>
4104 Show only names and status of changed files. See the description
4105 of the <code>--diff-filter</code> option on what the status letters mean.
4106 Just like <code>--name-only</code> the file names are often encoded in UTF-8.
4107 </p>
4108 </dd>
4109 <dt class="hdlist1">
4110 --submodule[=&lt;format&gt;]
4111 </dt>
4112 <dd>
4114 Specify how differences in submodules are shown. When specifying
4115 <code>--submodule=short</code> the <em>short</em> format is used. This format just
4116 shows the names of the commits at the beginning and end of the range.
4117 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
4118 format is used. This format lists the commits in the range like
4119 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
4120 is specified, the <em>diff</em> format is used. This format shows an
4121 inline diff of the changes in the submodule contents between the
4122 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
4123 if the config option is unset.
4124 </p>
4125 </dd>
4126 <dt class="hdlist1">
4127 --color[=&lt;when&gt;]
4128 </dt>
4129 <dd>
4131 Show colored diff.
4132 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
4133 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
4134 </p>
4135 </dd>
4136 <dt class="hdlist1">
4137 --no-color
4138 </dt>
4139 <dd>
4141 Turn off colored diff.
4142 It is the same as <code>--color=never</code>.
4143 </p>
4144 </dd>
4145 <dt class="hdlist1">
4146 --color-moved[=&lt;mode&gt;]
4147 </dt>
4148 <dd>
4150 Moved lines of code are colored differently.
4151 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
4152 and to <em>zebra</em> if the option with no mode is given.
4153 The mode must be one of:
4154 </p>
4155 <div class="openblock">
4156 <div class="content">
4157 <div class="dlist"><dl>
4158 <dt class="hdlist1">
4160 </dt>
4161 <dd>
4163 Moved lines are not highlighted.
4164 </p>
4165 </dd>
4166 <dt class="hdlist1">
4167 default
4168 </dt>
4169 <dd>
4171 Is a synonym for <code>zebra</code>. This may change to a more sensible mode
4172 in the future.
4173 </p>
4174 </dd>
4175 <dt class="hdlist1">
4176 plain
4177 </dt>
4178 <dd>
4180 Any line that is added in one location and was removed
4181 in another location will be colored with <em>color.diff.newMoved</em>.
4182 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
4183 that are added somewhere else in the diff. This mode picks up any
4184 moved line, but it is not very useful in a review to determine
4185 if a block of code was moved without permutation.
4186 </p>
4187 </dd>
4188 <dt class="hdlist1">
4189 blocks
4190 </dt>
4191 <dd>
4193 Blocks of moved text of at least 20 alphanumeric characters
4194 are detected greedily. The detected blocks are
4195 painted using either the <em>color.diff.{old,new}Moved</em> color.
4196 Adjacent blocks cannot be told apart.
4197 </p>
4198 </dd>
4199 <dt class="hdlist1">
4200 zebra
4201 </dt>
4202 <dd>
4204 Blocks of moved text are detected as in <em>blocks</em> mode. The blocks
4205 are painted using either the <em>color.diff.{old,new}Moved</em> color or
4206 <em>color.diff.{old,new}MovedAlternative</em>. The change between
4207 the two colors indicates that a new block was detected.
4208 </p>
4209 </dd>
4210 <dt class="hdlist1">
4211 dimmed-zebra
4212 </dt>
4213 <dd>
4215 Similar to <em>zebra</em>, but additional dimming of uninteresting parts
4216 of moved code is performed. The bordering lines of two adjacent
4217 blocks are considered interesting, the rest is uninteresting.
4218 <code>dimmed_zebra</code> is a deprecated synonym.
4219 </p>
4220 </dd>
4221 </dl></div>
4222 </div></div>
4223 </dd>
4224 <dt class="hdlist1">
4225 --no-color-moved
4226 </dt>
4227 <dd>
4229 Turn off move detection. This can be used to override configuration
4230 settings. It is the same as <code>--color-moved=no</code>.
4231 </p>
4232 </dd>
4233 <dt class="hdlist1">
4234 --color-moved-ws=&lt;modes&gt;
4235 </dt>
4236 <dd>
4238 This configures how whitespace is ignored when performing the
4239 move detection for <code>--color-moved</code>.
4240 These modes can be given as a comma separated list:
4241 </p>
4242 <div class="openblock">
4243 <div class="content">
4244 <div class="dlist"><dl>
4245 <dt class="hdlist1">
4247 </dt>
4248 <dd>
4250 Do not ignore whitespace when performing move detection.
4251 </p>
4252 </dd>
4253 <dt class="hdlist1">
4254 ignore-space-at-eol
4255 </dt>
4256 <dd>
4258 Ignore changes in whitespace at EOL.
4259 </p>
4260 </dd>
4261 <dt class="hdlist1">
4262 ignore-space-change
4263 </dt>
4264 <dd>
4266 Ignore changes in amount of whitespace. This ignores whitespace
4267 at line end, and considers all other sequences of one or
4268 more whitespace characters to be equivalent.
4269 </p>
4270 </dd>
4271 <dt class="hdlist1">
4272 ignore-all-space
4273 </dt>
4274 <dd>
4276 Ignore whitespace when comparing lines. This ignores differences
4277 even if one line has whitespace where the other line has none.
4278 </p>
4279 </dd>
4280 <dt class="hdlist1">
4281 allow-indentation-change
4282 </dt>
4283 <dd>
4285 Initially ignore any whitespace in the move detection, then
4286 group the moved code blocks only into a block if the change in
4287 whitespace is the same per line. This is incompatible with the
4288 other modes.
4289 </p>
4290 </dd>
4291 </dl></div>
4292 </div></div>
4293 </dd>
4294 <dt class="hdlist1">
4295 --no-color-moved-ws
4296 </dt>
4297 <dd>
4299 Do not ignore whitespace when performing move detection. This can be
4300 used to override configuration settings. It is the same as
4301 <code>--color-moved-ws=no</code>.
4302 </p>
4303 </dd>
4304 <dt class="hdlist1">
4305 --word-diff[=&lt;mode&gt;]
4306 </dt>
4307 <dd>
4309 Show a word diff, using the &lt;mode&gt; to delimit changed words.
4310 By default, words are delimited by whitespace; see
4311 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
4312 must be one of:
4313 </p>
4314 <div class="openblock">
4315 <div class="content">
4316 <div class="dlist"><dl>
4317 <dt class="hdlist1">
4318 color
4319 </dt>
4320 <dd>
4322 Highlight changed words using only colors. Implies <code>--color</code>.
4323 </p>
4324 </dd>
4325 <dt class="hdlist1">
4326 plain
4327 </dt>
4328 <dd>
4330 Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
4331 attempts to escape the delimiters if they appear in the input,
4332 so the output may be ambiguous.
4333 </p>
4334 </dd>
4335 <dt class="hdlist1">
4336 porcelain
4337 </dt>
4338 <dd>
4340 Use a special line-based format intended for script
4341 consumption. Added/removed/unchanged runs are printed in the
4342 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
4343 character at the beginning of the line and extending to the
4344 end of the line. Newlines in the input are represented by a
4345 tilde <code>~</code> on a line of its own.
4346 </p>
4347 </dd>
4348 <dt class="hdlist1">
4349 none
4350 </dt>
4351 <dd>
4353 Disable word diff again.
4354 </p>
4355 </dd>
4356 </dl></div>
4357 </div></div>
4358 <div class="paragraph"><p>Note that despite the name of the first mode, color is used to
4359 highlight the changed parts in all modes if enabled.</p></div>
4360 </dd>
4361 <dt class="hdlist1">
4362 --word-diff-regex=&lt;regex&gt;
4363 </dt>
4364 <dd>
4366 Use &lt;regex&gt; to decide what a word is, instead of considering
4367 runs of non-whitespace to be a word. Also implies
4368 <code>--word-diff</code> unless it was already enabled.
4369 </p>
4370 <div class="paragraph"><p>Every non-overlapping match of the
4371 &lt;regex&gt; is considered a word. Anything between these matches is
4372 considered whitespace and ignored(!) for the purposes of finding
4373 differences. You may want to append <code>|[^[:space:]]</code> to your regular
4374 expression to make sure that it matches all non-whitespace characters.
4375 A match that contains a newline is silently truncated(!) at the
4376 newline.</p></div>
4377 <div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
4378 and, correspondingly, show differences character by character.</p></div>
4379 <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
4380 <a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
4381 overrides any diff driver or configuration setting. Diff drivers
4382 override configuration settings.</p></div>
4383 </dd>
4384 <dt class="hdlist1">
4385 --color-words[=&lt;regex&gt;]
4386 </dt>
4387 <dd>
4389 Equivalent to <code>--word-diff=color</code> plus (if a regex was
4390 specified) <code>--word-diff-regex=&lt;regex&gt;</code>.
4391 </p>
4392 </dd>
4393 <dt class="hdlist1">
4394 --no-renames
4395 </dt>
4396 <dd>
4398 Turn off rename detection, even when the configuration
4399 file gives the default to do so.
4400 </p>
4401 </dd>
4402 <dt class="hdlist1">
4403 --[no-]rename-empty
4404 </dt>
4405 <dd>
4407 Whether to use empty blobs as rename source.
4408 </p>
4409 </dd>
4410 <dt class="hdlist1">
4411 --check
4412 </dt>
4413 <dd>
4415 Warn if changes introduce conflict markers or whitespace errors.
4416 What are considered whitespace errors is controlled by <code>core.whitespace</code>
4417 configuration. By default, trailing whitespaces (including
4418 lines that consist solely of whitespaces) and a space character
4419 that is immediately followed by a tab character inside the
4420 initial indent of the line are considered whitespace errors.
4421 Exits with non-zero status if problems are found. Not compatible
4422 with --exit-code.
4423 </p>
4424 </dd>
4425 <dt class="hdlist1">
4426 --ws-error-highlight=&lt;kind&gt;
4427 </dt>
4428 <dd>
4430 Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
4431 lines of the diff. Multiple values are separated by comma,
4432 <code>none</code> resets previous values, <code>default</code> reset the list to
4433 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
4434 this option is not given, and the configuration variable
4435 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
4436 <code>new</code> lines are highlighted. The whitespace errors are colored
4437 with <code>color.diff.whitespace</code>.
4438 </p>
4439 </dd>
4440 <dt class="hdlist1">
4441 --full-index
4442 </dt>
4443 <dd>
4445 Instead of the first handful of characters, show the full
4446 pre- and post-image blob object names on the "index"
4447 line when generating patch format output.
4448 </p>
4449 </dd>
4450 <dt class="hdlist1">
4451 --binary
4452 </dt>
4453 <dd>
4455 In addition to <code>--full-index</code>, output a binary diff that
4456 can be applied with <code>git-apply</code>.
4457 Implies <code>--patch</code>.
4458 </p>
4459 </dd>
4460 <dt class="hdlist1">
4461 --abbrev[=&lt;n&gt;]
4462 </dt>
4463 <dd>
4465 Instead of showing the full 40-byte hexadecimal object
4466 name in diff-raw format output and diff-tree header
4467 lines, show the shortest prefix that is at least <em>&lt;n&gt;</em>
4468 hexdigits long that uniquely refers the object.
4469 In diff-patch output format, <code>--full-index</code> takes higher
4470 precedence, i.e. if <code>--full-index</code> is specified, full blob
4471 names will be shown regardless of <code>--abbrev</code>.
4472 Non default number of digits can be specified with <code>--abbrev=&lt;n&gt;</code>.
4473 </p>
4474 </dd>
4475 <dt class="hdlist1">
4476 -B[&lt;n&gt;][/&lt;m&gt;]
4477 </dt>
4478 <dt class="hdlist1">
4479 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
4480 </dt>
4481 <dd>
4483 Break complete rewrite changes into pairs of delete and
4484 create. This serves two purposes:
4485 </p>
4486 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
4487 not as a series of deletion and insertion mixed together with a very
4488 few lines that happen to match textually as the context, but as a
4489 single deletion of everything old followed by a single insertion of
4490 everything new, and the number <code>m</code> controls this aspect of the -B
4491 option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
4492 original should remain in the result for Git to consider it a total
4493 rewrite (i.e. otherwise the resulting patch will be a series of
4494 deletion and insertion mixed together with context lines).</p></div>
4495 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
4496 source of a rename (usually -M only considers a file that disappeared
4497 as the source of a rename), and the number <code>n</code> controls this aspect of
4498 the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
4499 addition and deletion compared to 20% or more of the file&#8217;s size are
4500 eligible for being picked up as a possible source of a rename to
4501 another file.</p></div>
4502 </dd>
4503 <dt class="hdlist1">
4504 -M[&lt;n&gt;]
4505 </dt>
4506 <dt class="hdlist1">
4507 --find-renames[=&lt;n&gt;]
4508 </dt>
4509 <dd>
4511 If generating diffs, detect and report renames for each commit.
4512 For following files across renames while traversing history, see
4513 <code>--follow</code>.
4514 If <code>n</code> is specified, it is a threshold on the similarity
4515 index (i.e. amount of addition/deletions compared to the
4516 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
4517 delete/add pair to be a rename if more than 90% of the file
4518 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
4519 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
4520 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
4521 the same as <code>-M5%</code>. To limit detection to exact renames, use
4522 <code>-M100%</code>. The default similarity index is 50%.
4523 </p>
4524 </dd>
4525 <dt class="hdlist1">
4526 -C[&lt;n&gt;]
4527 </dt>
4528 <dt class="hdlist1">
4529 --find-copies[=&lt;n&gt;]
4530 </dt>
4531 <dd>
4533 Detect copies as well as renames. See also <code>--find-copies-harder</code>.
4534 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.
4535 </p>
4536 </dd>
4537 <dt class="hdlist1">
4538 --find-copies-harder
4539 </dt>
4540 <dd>
4542 For performance reasons, by default, <code>-C</code> option finds copies only
4543 if the original file of the copy was modified in the same
4544 changeset. This flag makes the command
4545 inspect unmodified files as candidates for the source of
4546 copy. This is a very expensive operation for large
4547 projects, so use it with caution. Giving more than one
4548 <code>-C</code> option has the same effect.
4549 </p>
4550 </dd>
4551 <dt class="hdlist1">
4553 </dt>
4554 <dt class="hdlist1">
4555 --irreversible-delete
4556 </dt>
4557 <dd>
4559 Omit the preimage for deletes, i.e. print only the header but not
4560 the diff between the preimage and <code>/dev/null</code>. The resulting patch
4561 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
4562 solely for people who want to just concentrate on reviewing the
4563 text after the change. In addition, the output obviously lacks
4564 enough information to apply such a patch in reverse, even manually,
4565 hence the name of the option.
4566 </p>
4567 <div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part
4568 of a delete/create pair.</p></div>
4569 </dd>
4570 <dt class="hdlist1">
4571 -l&lt;num&gt;
4572 </dt>
4573 <dd>
4575 The <code>-M</code> and <code>-C</code> options involve some preliminary steps that
4576 can detect subsets of renames/copies cheaply, followed by an
4577 exhaustive fallback portion that compares all remaining
4578 unpaired destinations to all relevant sources. (For renames,
4579 only remaining unpaired sources are relevant; for copies, all
4580 original sources are relevant.) For N sources and
4581 destinations, this exhaustive check is O(N^2). This option
4582 prevents the exhaustive portion of rename/copy detection from
4583 running if the number of source/destination files involved
4584 exceeds the specified number. Defaults to diff.renameLimit.
4585 Note that a value of 0 is treated as unlimited.
4586 </p>
4587 </dd>
4588 <dt class="hdlist1">
4589 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
4590 </dt>
4591 <dd>
4593 Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
4594 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
4595 type (i.e. regular file, symlink, submodule, &#8230;) changed (<code>T</code>),
4596 are Unmerged (<code>U</code>), are
4597 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
4598 Any combination of the filter characters (including none) can be used.
4599 When <code>*</code> (All-or-none) is added to the combination, all
4600 paths are selected if there is any file that matches
4601 other criteria in the comparison; if there is no file
4602 that matches other criteria, nothing is selected.
4603 </p>
4604 <div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
4605 <code>--diff-filter=ad</code> excludes added and deleted paths.</p></div>
4606 <div class="paragraph"><p>Note that not all diffs can feature all types. For instance, copied and
4607 renamed entries cannot appear if detection for those types is disabled.</p></div>
4608 </dd>
4609 <dt class="hdlist1">
4610 -S&lt;string&gt;
4611 </dt>
4612 <dd>
4614 Look for differences that change the number of occurrences of
4615 the specified string (i.e. addition/deletion) in a file.
4616 Intended for the scripter&#8217;s use.
4617 </p>
4618 <div class="paragraph"><p>It is useful when you&#8217;re looking for an exact block of code (like a
4619 struct), and want to know the history of that block since it first
4620 came into being: use the feature iteratively to feed the interesting
4621 block in the preimage back into <code>-S</code>, and keep going until you get the
4622 very first version of the block.</p></div>
4623 <div class="paragraph"><p>Binary files are searched as well.</p></div>
4624 </dd>
4625 <dt class="hdlist1">
4626 -G&lt;regex&gt;
4627 </dt>
4628 <dd>
4630 Look for differences whose patch text contains added/removed
4631 lines that match &lt;regex&gt;.
4632 </p>
4633 <div class="paragraph"><p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
4634 <code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
4635 file:</p></div>
4636 <div class="listingblock">
4637 <div class="content">
4638 <pre><code>+ return frotz(nitfol, two-&gt;ptr, 1, 0);
4640 - hit = frotz(nitfol, mf2.ptr, 1, 0);</code></pre>
4641 </div></div>
4642 <div class="paragraph"><p>While <code>git log -G"frotz\(nitfol"</code> will show this commit, <code>git log
4643 -S"frotz\(nitfol" --pickaxe-regex</code> will not (because the number of
4644 occurrences of that string did not change).</p></div>
4645 <div class="paragraph"><p>Unless <code>--text</code> is supplied patches of binary files without a textconv
4646 filter will be ignored.</p></div>
4647 <div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
4648 information.</p></div>
4649 </dd>
4650 <dt class="hdlist1">
4651 --find-object=&lt;object-id&gt;
4652 </dt>
4653 <dd>
4655 Look for differences that change the number of occurrences of
4656 the specified object. Similar to <code>-S</code>, just the argument is different
4657 in that it doesn&#8217;t search for a specific string but for a specific
4658 object id.
4659 </p>
4660 <div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
4661 <code>git-log</code> to also find trees.</p></div>
4662 </dd>
4663 <dt class="hdlist1">
4664 --pickaxe-all
4665 </dt>
4666 <dd>
4668 When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
4669 changeset, not just the files that contain the change
4670 in &lt;string&gt;.
4671 </p>
4672 </dd>
4673 <dt class="hdlist1">
4674 --pickaxe-regex
4675 </dt>
4676 <dd>
4678 Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
4679 expression to match.
4680 </p>
4681 </dd>
4682 <dt class="hdlist1">
4683 -O&lt;orderfile&gt;
4684 </dt>
4685 <dd>
4687 Control the order in which files appear in the output.
4688 This overrides the <code>diff.orderFile</code> configuration variable
4689 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
4690 use <code>-O/dev/null</code>.
4691 </p>
4692 <div class="paragraph"><p>The output order is determined by the order of glob patterns in
4693 &lt;orderfile&gt;.
4694 All files with pathnames that match the first pattern are output
4695 first, all files with pathnames that match the second pattern (but not
4696 the first) are output next, and so on.
4697 All files with pathnames that do not match any pattern are output
4698 last, as if there was an implicit match-all pattern at the end of the
4699 file.
4700 If multiple pathnames have the same rank (they match the same pattern
4701 but no earlier patterns), their output order relative to each other is
4702 the normal order.</p></div>
4703 <div class="paragraph"><p>&lt;orderfile&gt; is parsed as follows:</p></div>
4704 <div class="openblock">
4705 <div class="content">
4706 <div class="ulist"><ul>
4707 <li>
4709 Blank lines are ignored, so they can be used as separators for
4710 readability.
4711 </p>
4712 </li>
4713 <li>
4715 Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
4716 for comments. Add a backslash ("<code>\</code>") to the beginning of the
4717 pattern if it starts with a hash.
4718 </p>
4719 </li>
4720 <li>
4722 Each other line contains a single pattern.
4723 </p>
4724 </li>
4725 </ul></div>
4726 </div></div>
4727 <div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for
4728 fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
4729 matches a pattern if removing any number of the final pathname
4730 components matches the pattern. For example, the pattern "<code>foo*bar</code>"
4731 matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div>
4732 </dd>
4733 <dt class="hdlist1">
4734 --skip-to=&lt;file&gt;
4735 </dt>
4736 <dt class="hdlist1">
4737 --rotate-to=&lt;file&gt;
4738 </dt>
4739 <dd>
4741 Discard the files before the named &lt;file&gt; from the output
4742 (i.e. <em>skip to</em>), or move them to the end of the output
4743 (i.e. <em>rotate to</em>). These options were invented primarily for the use
4744 of the <code>git difftool</code> command, and may not be very useful
4745 otherwise.
4746 </p>
4747 </dd>
4748 <dt class="hdlist1">
4750 </dt>
4751 <dd>
4753 Swap two inputs; that is, show differences from index or
4754 on-disk file to tree contents.
4755 </p>
4756 </dd>
4757 <dt class="hdlist1">
4758 --relative[=&lt;path&gt;]
4759 </dt>
4760 <dt class="hdlist1">
4761 --no-relative
4762 </dt>
4763 <dd>
4765 When run from a subdirectory of the project, it can be
4766 told to exclude changes outside the directory and show
4767 pathnames relative to it with this option. When you are
4768 not in a subdirectory (e.g. in a bare repository), you
4769 can name which subdirectory to make the output relative
4770 to by giving a &lt;path&gt; as an argument.
4771 <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
4772 option and previous <code>--relative</code>.
4773 </p>
4774 </dd>
4775 <dt class="hdlist1">
4777 </dt>
4778 <dt class="hdlist1">
4779 --text
4780 </dt>
4781 <dd>
4783 Treat all files as text.
4784 </p>
4785 </dd>
4786 <dt class="hdlist1">
4787 --ignore-cr-at-eol
4788 </dt>
4789 <dd>
4791 Ignore carriage-return at the end of line when doing a comparison.
4792 </p>
4793 </dd>
4794 <dt class="hdlist1">
4795 --ignore-space-at-eol
4796 </dt>
4797 <dd>
4799 Ignore changes in whitespace at EOL.
4800 </p>
4801 </dd>
4802 <dt class="hdlist1">
4804 </dt>
4805 <dt class="hdlist1">
4806 --ignore-space-change
4807 </dt>
4808 <dd>
4810 Ignore changes in amount of whitespace. This ignores whitespace
4811 at line end, and considers all other sequences of one or
4812 more whitespace characters to be equivalent.
4813 </p>
4814 </dd>
4815 <dt class="hdlist1">
4817 </dt>
4818 <dt class="hdlist1">
4819 --ignore-all-space
4820 </dt>
4821 <dd>
4823 Ignore whitespace when comparing lines. This ignores
4824 differences even if one line has whitespace where the other
4825 line has none.
4826 </p>
4827 </dd>
4828 <dt class="hdlist1">
4829 --ignore-blank-lines
4830 </dt>
4831 <dd>
4833 Ignore changes whose lines are all blank.
4834 </p>
4835 </dd>
4836 <dt class="hdlist1">
4837 -I&lt;regex&gt;
4838 </dt>
4839 <dt class="hdlist1">
4840 --ignore-matching-lines=&lt;regex&gt;
4841 </dt>
4842 <dd>
4844 Ignore changes whose all lines match &lt;regex&gt;. This option may
4845 be specified more than once.
4846 </p>
4847 </dd>
4848 <dt class="hdlist1">
4849 --inter-hunk-context=&lt;lines&gt;
4850 </dt>
4851 <dd>
4853 Show the context between diff hunks, up to the specified number
4854 of lines, thereby fusing hunks that are close to each other.
4855 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
4856 is unset.
4857 </p>
4858 </dd>
4859 <dt class="hdlist1">
4861 </dt>
4862 <dt class="hdlist1">
4863 --function-context
4864 </dt>
4865 <dd>
4867 Show whole function as context lines for each change.
4868 The function names are determined in the same way as
4869 <code>git diff</code> works out patch hunk headers (see <em>Defining a
4870 custom hunk-header</em> in <a href="gitattributes.html">gitattributes(5)</a>).
4871 </p>
4872 </dd>
4873 <dt class="hdlist1">
4874 --ext-diff
4875 </dt>
4876 <dd>
4878 Allow an external diff helper to be executed. If you set an
4879 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
4880 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
4881 </p>
4882 </dd>
4883 <dt class="hdlist1">
4884 --no-ext-diff
4885 </dt>
4886 <dd>
4888 Disallow external diff drivers.
4889 </p>
4890 </dd>
4891 <dt class="hdlist1">
4892 --textconv
4893 </dt>
4894 <dt class="hdlist1">
4895 --no-textconv
4896 </dt>
4897 <dd>
4899 Allow (or disallow) external text conversion filters to be run
4900 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
4901 details. Because textconv filters are typically a one-way
4902 conversion, the resulting diff is suitable for human
4903 consumption, but cannot be applied. For this reason, textconv
4904 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
4905 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
4906 diff plumbing commands.
4907 </p>
4908 </dd>
4909 <dt class="hdlist1">
4910 --ignore-submodules[=&lt;when&gt;]
4911 </dt>
4912 <dd>
4914 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
4915 either "none", "untracked", "dirty" or "all", which is the default.
4916 Using "none" will consider the submodule modified when it either contains
4917 untracked or modified files or its HEAD differs from the commit recorded
4918 in the superproject and can be used to override any settings of the
4919 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
4920 "untracked" is used submodules are not considered dirty when they only
4921 contain untracked content (but they are still scanned for modified
4922 content). Using "dirty" ignores all changes to the work tree of submodules,
4923 only changes to the commits stored in the superproject are shown (this was
4924 the behavior until 1.7.0). Using "all" hides all changes to submodules.
4925 </p>
4926 </dd>
4927 <dt class="hdlist1">
4928 --src-prefix=&lt;prefix&gt;
4929 </dt>
4930 <dd>
4932 Show the given source prefix instead of "a/".
4933 </p>
4934 </dd>
4935 <dt class="hdlist1">
4936 --dst-prefix=&lt;prefix&gt;
4937 </dt>
4938 <dd>
4940 Show the given destination prefix instead of "b/".
4941 </p>
4942 </dd>
4943 <dt class="hdlist1">
4944 --no-prefix
4945 </dt>
4946 <dd>
4948 Do not show any source or destination prefix.
4949 </p>
4950 </dd>
4951 <dt class="hdlist1">
4952 --default-prefix
4953 </dt>
4954 <dd>
4956 Use the default source and destination prefixes ("a/" and "b/").
4957 This overrides configuration variables such as <code>diff.noprefix</code>,
4958 <code>diff.srcPrefix</code>, <code>diff.dstPrefix</code>, and <code>diff.mnemonicPrefix</code>
4959 (see <code>git-config</code>(1)).
4960 </p>
4961 </dd>
4962 <dt class="hdlist1">
4963 --line-prefix=&lt;prefix&gt;
4964 </dt>
4965 <dd>
4967 Prepend an additional prefix to every line of output.
4968 </p>
4969 </dd>
4970 <dt class="hdlist1">
4971 --ita-invisible-in-index
4972 </dt>
4973 <dd>
4975 By default entries added by "git add -N" appear as an existing
4976 empty file in "git diff" and a new file in "git diff --cached".
4977 This option makes the entry appear as a new file in "git diff"
4978 and non-existent in "git diff --cached". This option could be
4979 reverted with <code>--ita-visible-in-index</code>. Both options are
4980 experimental and could be removed in future.
4981 </p>
4982 </dd>
4983 </dl></div>
4984 <div class="paragraph"><p>For more detailed explanation on these common options, see also
4985 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
4986 </div>
4987 </div>
4988 <div class="sect1">
4989 <h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
4990 <div class="sectionbody">
4991 <div class="paragraph"><p>Running
4992 <a href="git-diff.html">git-diff(1)</a>,
4993 <a href="git-log.html">git-log(1)</a>,
4994 <a href="git-show.html">git-show(1)</a>,
4995 <a href="git-diff-index.html">git-diff-index(1)</a>,
4996 <a href="git-diff-tree.html">git-diff-tree(1)</a>, or
4997 <a href="git-diff-files.html">git-diff-files(1)</a>
4998 with the <code>-p</code> option produces patch text.
4999 You can customize the creation of patch text via the
5000 <code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables
5001 (see <a href="git.html">git(1)</a>), and the <code>diff</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).</p></div>
5002 <div class="paragraph"><p>What the -p option produces is slightly different from the traditional
5003 diff format:</p></div>
5004 <div class="olist arabic"><ol class="arabic">
5005 <li>
5007 It is preceded by a "git diff" header that looks like this:
5008 </p>
5009 <div class="literalblock">
5010 <div class="content">
5011 <pre><code>diff --git a/file1 b/file2</code></pre>
5012 </div></div>
5013 <div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
5014 involved. Especially, even for a creation or a deletion,
5015 <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div>
5016 <div class="paragraph"><p>When a rename/copy is involved, <code>file1</code> and <code>file2</code> show the
5017 name of the source file of the rename/copy and the name of
5018 the file that the rename/copy produces, respectively.</p></div>
5019 </li>
5020 <li>
5022 It is followed by one or more extended header lines:
5023 </p>
5024 <div class="literalblock">
5025 <div class="content">
5026 <pre><code>old mode &lt;mode&gt;
5027 new mode &lt;mode&gt;
5028 deleted file mode &lt;mode&gt;
5029 new file mode &lt;mode&gt;
5030 copy from &lt;path&gt;
5031 copy to &lt;path&gt;
5032 rename from &lt;path&gt;
5033 rename to &lt;path&gt;
5034 similarity index &lt;number&gt;
5035 dissimilarity index &lt;number&gt;
5036 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</code></pre>
5037 </div></div>
5038 <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
5039 and file permission bits.</p></div>
5040 <div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div>
5041 <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
5042 the dissimilarity index is the percentage of changed lines. It
5043 is a rounded down integer, followed by a percent sign. The
5044 similarity index value of 100% is thus reserved for two equal
5045 files, while 100% dissimilarity means that no line from the old
5046 file made it into the new one.</p></div>
5047 <div class="paragraph"><p>The index line includes the blob object names before and after the change.
5048 The &lt;mode&gt; is included if the file mode does not change; otherwise,
5049 separate lines indicate the old and the new mode.</p></div>
5050 </li>
5051 <li>
5053 Pathnames with "unusual" characters are quoted as explained for
5054 the configuration variable <code>core.quotePath</code> (see
5055 <a href="git-config.html">git-config(1)</a>).
5056 </p>
5057 </li>
5058 <li>
5060 All the <code>file1</code> files in the output refer to files before the
5061 commit, and all the <code>file2</code> files refer to files after the commit.
5062 It is incorrect to apply each change to each file sequentially. For
5063 example, this patch will swap a and b:
5064 </p>
5065 <div class="literalblock">
5066 <div class="content">
5067 <pre><code>diff --git a/a b/b
5068 rename from a
5069 rename to b
5070 diff --git a/b b/a
5071 rename from b
5072 rename to a</code></pre>
5073 </div></div>
5074 </li>
5075 <li>
5077 Hunk headers mention the name of the function to which the hunk
5078 applies. See "Defining a custom hunk-header" in
5079 <a href="gitattributes.html">gitattributes(5)</a> for details of how to tailor this to
5080 specific languages.
5081 </p>
5082 </li>
5083 </ol></div>
5084 </div>
5085 </div>
5086 <div class="sect1">
5087 <h2 id="_combined_diff_format">Combined diff format</h2>
5088 <div class="sectionbody">
5089 <div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
5090 produce a <em>combined diff</em> when showing a merge. This is the default
5091 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
5092 <a href="git-show.html">git-show(1)</a>. Note also that you can give suitable
5093 <code>--diff-merges</code> option to any of these commands to force generation of
5094 diffs in a specific format.</p></div>
5095 <div class="paragraph"><p>A "combined diff" format looks like this:</p></div>
5096 <div class="listingblock">
5097 <div class="content">
5098 <pre><code>diff --combined describe.c
5099 index fabadb8,cc95eb0..4866510
5100 --- a/describe.c
5101 +++ b/describe.c
5102 @@@ -98,20 -98,12 +98,20 @@@
5103 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
5106 - static void describe(char *arg)
5107 -static void describe(struct commit *cmit, int last_one)
5108 ++static void describe(char *arg, int last_one)
5110 + unsigned char sha1[20];
5111 + struct commit *cmit;
5112 struct commit_list *list;
5113 static int initialized = 0;
5114 struct commit_name *n;
5116 + if (get_sha1(arg, sha1) &lt; 0)
5117 + usage(describe_usage);
5118 + cmit = lookup_commit_reference(sha1);
5119 + if (!cmit)
5120 + usage(describe_usage);
5122 if (!initialized) {
5123 initialized = 1;
5124 for_each_ref(get_name);</code></pre>
5125 </div></div>
5126 <div class="olist arabic"><ol class="arabic">
5127 <li>
5129 It is preceded by a "git diff" header, that looks like
5130 this (when the <code>-c</code> option is used):
5131 </p>
5132 <div class="literalblock">
5133 <div class="content">
5134 <pre><code>diff --combined file</code></pre>
5135 </div></div>
5136 <div class="paragraph"><p>or like this (when the <code>--cc</code> option is used):</p></div>
5137 <div class="literalblock">
5138 <div class="content">
5139 <pre><code>diff --cc file</code></pre>
5140 </div></div>
5141 </li>
5142 <li>
5144 It is followed by one or more extended header lines
5145 (this example shows a merge with two parents):
5146 </p>
5147 <div class="literalblock">
5148 <div class="content">
5149 <pre><code>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
5150 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
5151 new file mode &lt;mode&gt;
5152 deleted file mode &lt;mode&gt;,&lt;mode&gt;</code></pre>
5153 </div></div>
5154 <div class="paragraph"><p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
5155 the &lt;mode&gt; is different from the rest. Extended headers with
5156 information about detected content movement (renames and
5157 copying detection) are designed to work with the diff of two
5158 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
5159 </li>
5160 <li>
5162 It is followed by a two-line from-file/to-file header:
5163 </p>
5164 <div class="literalblock">
5165 <div class="content">
5166 <pre><code>--- a/file
5167 +++ b/file</code></pre>
5168 </div></div>
5169 <div class="paragraph"><p>Similar to the two-line header for the traditional <em>unified</em> diff
5170 format, <code>/dev/null</code> is used to signal created or deleted
5171 files.</p></div>
5172 <div class="paragraph"><p>However, if the --combined-all-paths option is provided, instead of a
5173 two-line from-file/to-file, you get an N+1 line from-file/to-file header,
5174 where N is the number of parents in the merge commit:</p></div>
5175 <div class="literalblock">
5176 <div class="content">
5177 <pre><code>--- a/file
5178 --- a/file
5179 --- a/file
5180 +++ b/file</code></pre>
5181 </div></div>
5182 <div class="paragraph"><p>This extended format can be useful if rename or copy detection is
5183 active, to allow you to see the original name of the file in different
5184 parents.</p></div>
5185 </li>
5186 <li>
5188 Chunk header format is modified to prevent people from
5189 accidentally feeding it to <code>patch -p1</code>. Combined diff format
5190 was created for review of merge commit changes, and was not
5191 meant to be applied. The change is similar to the change in the
5192 extended <em>index</em> header:
5193 </p>
5194 <div class="literalblock">
5195 <div class="content">
5196 <pre><code>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</code></pre>
5197 </div></div>
5198 <div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk
5199 header for combined diff format.</p></div>
5200 </li>
5201 </ol></div>
5202 <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
5203 files A and B with a single column that has <code>-</code> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <code>+</code> (plus&#8201;&#8212;&#8201;missing in A but
5204 added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
5205 compares two or more files file1, file2,&#8230; with one file X, and
5206 shows how X differs from each of fileN. One column for each of
5207 fileN is prepended to the output line to note how X&#8217;s line is
5208 different from it.</p></div>
5209 <div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in
5210 fileN but it does not appear in the result. A <code>+</code> character
5211 in the column N means that the line appears in the result,
5212 and fileN does not have that line (in other words, the line was
5213 added, from the point of view of that parent).</p></div>
5214 <div class="paragraph"><p>In the above example output, the function signature was changed
5215 from both files (hence two <code>-</code> removals from both file1 and
5216 file2, plus <code>++</code> to mean one line that was added does not appear
5217 in either file1 or file2). Also, eight other lines are the same
5218 from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div>
5219 <div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
5220 merge commit with the merge result (i.e. file1..fileN are the
5221 parents). When shown by <code>git diff-files -c</code>, it compares the
5222 two unresolved merge parents with the working tree file
5223 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
5224 "their version").</p></div>
5225 </div>
5226 </div>
5227 <div class="sect1">
5228 <h2 id="_examples">EXAMPLES</h2>
5229 <div class="sectionbody">
5230 <div class="dlist"><dl>
5231 <dt class="hdlist1">
5232 <code>git log --no-merges</code>
5233 </dt>
5234 <dd>
5236 Show the whole commit history, but skip any merges
5237 </p>
5238 </dd>
5239 <dt class="hdlist1">
5240 <code>git log v2.6.12.. include/scsi drivers/scsi</code>
5241 </dt>
5242 <dd>
5244 Show all commits since version <em>v2.6.12</em> that changed any file
5245 in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories
5246 </p>
5247 </dd>
5248 <dt class="hdlist1">
5249 <code>git log --since="2 weeks ago" -- gitk</code>
5250 </dt>
5251 <dd>
5253 Show the changes during the last two weeks to the file <em>gitk</em>.
5254 The <code>--</code> is necessary to avoid confusion with the <strong>branch</strong> named
5255 <em>gitk</em>
5256 </p>
5257 </dd>
5258 <dt class="hdlist1">
5259 <code>git log --name-status release..test</code>
5260 </dt>
5261 <dd>
5263 Show the commits that are in the "test" branch but not yet
5264 in the "release" branch, along with the list of paths
5265 each commit modifies.
5266 </p>
5267 </dd>
5268 <dt class="hdlist1">
5269 <code>git log --follow builtin/rev-list.c</code>
5270 </dt>
5271 <dd>
5273 Shows the commits that changed <code>builtin/rev-list.c</code>, including
5274 those commits that occurred before the file was given its
5275 present name.
5276 </p>
5277 </dd>
5278 <dt class="hdlist1">
5279 <code>git log --branches --not --remotes=origin</code>
5280 </dt>
5281 <dd>
5283 Shows all commits that are in any of local branches but not in
5284 any of remote-tracking branches for <em>origin</em> (what you have that
5285 origin doesn&#8217;t).
5286 </p>
5287 </dd>
5288 <dt class="hdlist1">
5289 <code>git log master --not --remotes=*/master</code>
5290 </dt>
5291 <dd>
5293 Shows all commits that are in local master but not in any remote
5294 repository master branches.
5295 </p>
5296 </dd>
5297 <dt class="hdlist1">
5298 <code>git log -p -m --first-parent</code>
5299 </dt>
5300 <dd>
5302 Shows the history including change diffs, but only from the
5303 &#8220;main branch&#8221; perspective, skipping commits that come from merged
5304 branches, and showing full diffs of changes introduced by the merges.
5305 This makes sense only when following a strict policy of merging all
5306 topic branches when staying on a single integration branch.
5307 </p>
5308 </dd>
5309 <dt class="hdlist1">
5310 <code>git log -L '/int main/',/^}/:main.c</code>
5311 </dt>
5312 <dd>
5314 Shows how the function <code>main()</code> in the file <code>main.c</code> evolved
5315 over time.
5316 </p>
5317 </dd>
5318 <dt class="hdlist1">
5319 <code>git log -3</code>
5320 </dt>
5321 <dd>
5323 Limits the number of commits to show to 3.
5324 </p>
5325 </dd>
5326 </dl></div>
5327 </div>
5328 </div>
5329 <div class="sect1">
5330 <h2 id="_discussion">DISCUSSION</h2>
5331 <div class="sectionbody">
5332 <div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div>
5333 <div class="ulist"><ul>
5334 <li>
5336 The contents of the blob objects are uninterpreted sequences
5337 of bytes. There is no encoding translation at the core
5338 level.
5339 </p>
5340 </li>
5341 <li>
5343 Path names are encoded in UTF-8 normalization form C. This
5344 applies to tree objects, the index file, ref names, as well as
5345 path names in command line arguments, environment variables
5346 and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>),
5347 <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
5348 <a href="gitmodules.html">gitmodules(5)</a>).
5349 </p>
5350 <div class="paragraph"><p>Note that Git at the core level treats path names simply as
5351 sequences of non-NUL bytes, there are no path name encoding
5352 conversions (except on Mac and Windows). Therefore, using
5353 non-ASCII path names will mostly work even on platforms and file
5354 systems that use legacy extended ASCII encodings. However,
5355 repositories created on such systems will not work properly on
5356 UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
5357 Additionally, many Git-based tools simply assume path names to
5358 be UTF-8 and will fail to display other encodings correctly.</p></div>
5359 </li>
5360 <li>
5362 Commit log messages are typically encoded in UTF-8, but other
5363 extended ASCII encodings are also supported. This includes
5364 ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
5365 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
5366 EUC-x, CP9xx etc.).
5367 </p>
5368 </li>
5369 </ul></div>
5370 <div class="paragraph"><p>Although we encourage that the commit log messages are encoded
5371 in UTF-8, both the core and Git Porcelain are designed not to
5372 force UTF-8 on projects. If all participants of a particular
5373 project find it more convenient to use legacy encodings, Git
5374 does not forbid it. However, there are a few things to keep in
5375 mind.</p></div>
5376 <div class="olist arabic"><ol class="arabic">
5377 <li>
5379 <em>git commit</em> and <em>git commit-tree</em> issue
5380 a warning if the commit log message given to it does not look
5381 like a valid UTF-8 string, unless you explicitly say your
5382 project uses a legacy encoding. The way to say this is to
5383 have <code>i18n.commitEncoding</code> in <code>.git/config</code> file, like this:
5384 </p>
5385 <div class="listingblock">
5386 <div class="content">
5387 <pre><code>[i18n]
5388 commitEncoding = ISO-8859-1</code></pre>
5389 </div></div>
5390 <div class="paragraph"><p>Commit objects created with the above setting record the value
5391 of <code>i18n.commitEncoding</code> in their <code>encoding</code> header. This is to
5392 help other people who look at them later. Lack of this header
5393 implies that the commit log message is encoded in UTF-8.</p></div>
5394 </li>
5395 <li>
5397 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
5398 <code>encoding</code> header of a commit object, and try to re-code the
5399 log message into UTF-8 unless otherwise specified. You can
5400 specify the desired output encoding with
5401 <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this:
5402 </p>
5403 <div class="listingblock">
5404 <div class="content">
5405 <pre><code>[i18n]
5406 logOutputEncoding = ISO-8859-1</code></pre>
5407 </div></div>
5408 <div class="paragraph"><p>If you do not have this configuration variable, the value of
5409 <code>i18n.commitEncoding</code> is used instead.</p></div>
5410 </li>
5411 </ol></div>
5412 <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
5413 message when a commit is made to force UTF-8 at the commit
5414 object level, because re-coding to UTF-8 is not necessarily a
5415 reversible operation.</p></div>
5416 </div>
5417 </div>
5418 <div class="sect1">
5419 <h2 id="_configuration">CONFIGURATION</h2>
5420 <div class="sectionbody">
5421 <div class="paragraph"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a>
5422 for settings related to diff generation.</p></div>
5423 <div class="dlist"><dl>
5424 <dt class="hdlist1">
5425 format.pretty
5426 </dt>
5427 <dd>
5429 Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.)
5430 Defaults to <code>medium</code>.
5431 </p>
5432 </dd>
5433 <dt class="hdlist1">
5434 i18n.logOutputEncoding
5435 </dt>
5436 <dd>
5438 Encoding to use when displaying logs. (See <em>Discussion</em> above.)
5439 Defaults to the value of <code>i18n.commitEncoding</code> if set, and UTF-8
5440 otherwise.
5441 </p>
5442 </dd>
5443 </dl></div>
5444 <div class="paragraph"><p>Everything above this line in this section isn&#8217;t included from the
5445 <a href="git-config.html">git-config(1)</a> documentation. The content that follows is the
5446 same as what&#8217;s found there:</p></div>
5447 <div class="dlist"><dl>
5448 <dt class="hdlist1">
5449 log.abbrevCommit
5450 </dt>
5451 <dd>
5453 If true, makes <a href="git-log.html">git-log(1)</a>, <a href="git-show.html">git-show(1)</a>, and
5454 <a href="git-whatchanged.html">git-whatchanged(1)</a> assume <code>--abbrev-commit</code>. You may
5455 override this option with <code>--no-abbrev-commit</code>.
5456 </p>
5457 </dd>
5458 <dt class="hdlist1">
5459 log.date
5460 </dt>
5461 <dd>
5463 Set the default date-time mode for the <em>log</em> command.
5464 Setting a value for log.date is similar to using <em>git log</em>'s
5465 <code>--date</code> option. See <a href="git-log.html">git-log(1)</a> for details.
5466 </p>
5467 <div class="paragraph"><p>If the format is set to "auto:foo" and the pager is in use, format
5468 "foo" will be used for the date format. Otherwise, "default" will
5469 be used.</p></div>
5470 </dd>
5471 <dt class="hdlist1">
5472 log.decorate
5473 </dt>
5474 <dd>
5476 Print out the ref names of any commits that are shown by the log
5477 command. If <em>short</em> is specified, the ref name prefixes <em>refs/heads/</em>,
5478 <em>refs/tags/</em> and <em>refs/remotes/</em> will not be printed. If <em>full</em> is
5479 specified, the full ref name (including prefix) will be printed.
5480 If <em>auto</em> is specified, then if the output is going to a terminal,
5481 the ref names are shown as if <em>short</em> were given, otherwise no ref
5482 names are shown. This is the same as the <code>--decorate</code> option
5483 of the <code>git log</code>.
5484 </p>
5485 </dd>
5486 <dt class="hdlist1">
5487 log.initialDecorationSet
5488 </dt>
5489 <dd>
5491 By default, <code>git log</code> only shows decorations for certain known ref
5492 namespaces. If <em>all</em> is specified, then show all refs as
5493 decorations.
5494 </p>
5495 </dd>
5496 <dt class="hdlist1">
5497 log.excludeDecoration
5498 </dt>
5499 <dd>
5501 Exclude the specified patterns from the log decorations. This is
5502 similar to the <code>--decorate-refs-exclude</code> command-line option, but
5503 the config option can be overridden by the <code>--decorate-refs</code>
5504 option.
5505 </p>
5506 </dd>
5507 <dt class="hdlist1">
5508 log.diffMerges
5509 </dt>
5510 <dd>
5512 Set diff format to be used when <code>--diff-merges=on</code> is
5513 specified, see <code>--diff-merges</code> in <a href="git-log.html">git-log(1)</a> for
5514 details. Defaults to <code>separate</code>.
5515 </p>
5516 </dd>
5517 <dt class="hdlist1">
5518 log.follow
5519 </dt>
5520 <dd>
5522 If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when
5523 a single &lt;path&gt; is given. This has the same limitations as <code>--follow</code>,
5524 i.e. it cannot be used to follow multiple files and does not work well
5525 on non-linear history.
5526 </p>
5527 </dd>
5528 <dt class="hdlist1">
5529 log.graphColors
5530 </dt>
5531 <dd>
5533 A list of colors, separated by commas, that can be used to draw
5534 history lines in <code>git log --graph</code>.
5535 </p>
5536 </dd>
5537 <dt class="hdlist1">
5538 log.showRoot
5539 </dt>
5540 <dd>
5542 If true, the initial commit will be shown as a big creation event.
5543 This is equivalent to a diff against an empty tree.
5544 Tools like <a href="git-log.html">git-log(1)</a> or <a href="git-whatchanged.html">git-whatchanged(1)</a>, which
5545 normally hide the root commit will now show it. True by default.
5546 </p>
5547 </dd>
5548 <dt class="hdlist1">
5549 log.showSignature
5550 </dt>
5551 <dd>
5553 If true, makes <a href="git-log.html">git-log(1)</a>, <a href="git-show.html">git-show(1)</a>, and
5554 <a href="git-whatchanged.html">git-whatchanged(1)</a> assume <code>--show-signature</code>.
5555 </p>
5556 </dd>
5557 <dt class="hdlist1">
5558 log.mailmap
5559 </dt>
5560 <dd>
5562 If true, makes <a href="git-log.html">git-log(1)</a>, <a href="git-show.html">git-show(1)</a>, and
5563 <a href="git-whatchanged.html">git-whatchanged(1)</a> assume <code>--use-mailmap</code>, otherwise
5564 assume <code>--no-use-mailmap</code>. True by default.
5565 </p>
5566 </dd>
5567 <dt class="hdlist1">
5568 notes.mergeStrategy
5569 </dt>
5570 <dd>
5572 Which merge strategy to choose by default when resolving notes
5573 conflicts. Must be one of <code>manual</code>, <code>ours</code>, <code>theirs</code>, <code>union</code>, or
5574 <code>cat_sort_uniq</code>. Defaults to <code>manual</code>. See the "NOTES MERGE STRATEGIES"
5575 section of <a href="git-notes.html">git-notes(1)</a> for more information on each strategy.
5576 </p>
5577 <div class="paragraph"><p>This setting can be overridden by passing the <code>--strategy</code> option to
5578 <a href="git-notes.html">git-notes(1)</a>.</p></div>
5579 </dd>
5580 <dt class="hdlist1">
5581 notes.&lt;name&gt;.mergeStrategy
5582 </dt>
5583 <dd>
5585 Which merge strategy to choose when doing a notes merge into
5586 refs/notes/&lt;name&gt;. This overrides the more general
5587 "notes.mergeStrategy". See the "NOTES MERGE STRATEGIES" section in
5588 <a href="git-notes.html">git-notes(1)</a> for more information on the available strategies.
5589 </p>
5590 </dd>
5591 <dt class="hdlist1">
5592 notes.displayRef
5593 </dt>
5594 <dd>
5596 Which ref (or refs, if a glob or specified more than once), in
5597 addition to the default set by <code>core.notesRef</code> or
5598 <code>GIT_NOTES_REF</code>, to read notes from when showing commit
5599 messages with the <em>git log</em> family of commands.
5600 </p>
5601 <div class="paragraph"><p>This setting can be overridden with the <code>GIT_NOTES_DISPLAY_REF</code>
5602 environment variable, which must be a colon separated list of refs or
5603 globs.</p></div>
5604 <div class="paragraph"><p>A warning will be issued for refs that do not exist,
5605 but a glob that does not match any refs is silently ignored.</p></div>
5606 <div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option to the <em>git
5607 log</em> family of commands, or by the <code>--notes=&lt;ref&gt;</code> option accepted by
5608 those commands.</p></div>
5609 <div class="paragraph"><p>The effective value of "core.notesRef" (possibly overridden by
5610 GIT_NOTES_REF) is also implicitly added to the list of refs to be
5611 displayed.</p></div>
5612 </dd>
5613 <dt class="hdlist1">
5614 notes.rewrite.&lt;command&gt;
5615 </dt>
5616 <dd>
5618 When rewriting commits with &lt;command&gt; (currently <code>amend</code> or
5619 <code>rebase</code>), if this variable is <code>false</code>, git will not copy
5620 notes from the original to the rewritten commit. Defaults to
5621 <code>true</code>. See also "<code>notes.rewriteRef</code>" below.
5622 </p>
5623 <div class="paragraph"><p>This setting can be overridden with the <code>GIT_NOTES_REWRITE_REF</code>
5624 environment variable, which must be a colon separated list of refs or
5625 globs.</p></div>
5626 </dd>
5627 <dt class="hdlist1">
5628 notes.rewriteMode
5629 </dt>
5630 <dd>
5632 When copying notes during a rewrite (see the
5633 "notes.rewrite.&lt;command&gt;" option), determines what to do if
5634 the target commit already has a note. Must be one of
5635 <code>overwrite</code>, <code>concatenate</code>, <code>cat_sort_uniq</code>, or <code>ignore</code>.
5636 Defaults to <code>concatenate</code>.
5637 </p>
5638 <div class="paragraph"><p>This setting can be overridden with the <code>GIT_NOTES_REWRITE_MODE</code>
5639 environment variable.</p></div>
5640 </dd>
5641 <dt class="hdlist1">
5642 notes.rewriteRef
5643 </dt>
5644 <dd>
5646 When copying notes during a rewrite, specifies the (fully
5647 qualified) ref whose notes should be copied. May be a glob,
5648 in which case notes in all matching refs will be copied. You
5649 may also specify this configuration several times.
5650 </p>
5651 <div class="paragraph"><p>Does not have a default value; you must configure this variable to
5652 enable note rewriting. Set it to <code>refs/notes/commits</code> to enable
5653 rewriting for the default commit notes.</p></div>
5654 <div class="paragraph"><p>Can be overridden with the <code>GIT_NOTES_REWRITE_REF</code> environment variable.
5655 See <code>notes.rewrite.&lt;command&gt;</code> above for a further description of its format.</p></div>
5656 </dd>
5657 </dl></div>
5658 </div>
5659 </div>
5660 <div class="sect1">
5661 <h2 id="_git">GIT</h2>
5662 <div class="sectionbody">
5663 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
5664 </div>
5665 </div>
5666 </div>
5667 <div id="footnotes"><hr /></div>
5668 <div id="footer">
5669 <div id="footer-text">
5670 Last updated
5671 2023-10-23 14:43:46 PDT
5672 </div>
5673 </div>
5674 </body>
5675 </html>