Autogenerated HTML docs for v2.43.0-440-gb50a60
[git-htmldocs.git] / git-replay.html
blobf1cdc57ab0d5f2102ccecefd5c3ba0d278a4bf56
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-replay(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-replay(1) Manual Page
739 </h1>
740 <h2>NAME</h2>
741 <div class="sectionbody">
742 <p>git-replay -
743 EXPERIMENTAL: Replay commits on a new base, works with bare repos too
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">(EXPERIMENTAL!) <em>git replay</em> ([--contained] --onto &lt;newbase&gt; | --advance &lt;branch&gt;) &lt;revision-range&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>Takes ranges of commits and replays them onto a new location. Leaves
761 the working tree and the index untouched, and updates no references.
762 The output of this command is meant to be used as input to
763 <code>git update-ref --stdin</code>, which would update the relevant branches
764 (see the OUTPUT section below).</p></div>
765 <div class="paragraph"><p>THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.</p></div>
766 </div>
767 </div>
768 <div class="sect1">
769 <h2 id="_options">OPTIONS</h2>
770 <div class="sectionbody">
771 <div class="dlist"><dl>
772 <dt class="hdlist1">
773 --onto &lt;newbase&gt;
774 </dt>
775 <dd>
777 Starting point at which to create the new commits. May be any
778 valid commit, and not just an existing branch name.
779 </p>
780 <div class="paragraph"><p>When <code>--onto</code> is specified, the update-ref command(s) in the output will
781 update the branch(es) in the revision range to point at the new
782 commits, similar to the way how <code>git rebase --update-refs</code> updates
783 multiple branches in the affected range.</p></div>
784 </dd>
785 <dt class="hdlist1">
786 --advance &lt;branch&gt;
787 </dt>
788 <dd>
790 Starting point at which to create the new commits; must be a
791 branch name.
792 </p>
793 <div class="paragraph"><p>When <code>--advance</code> is specified, the update-ref command(s) in the output
794 will update the branch passed as an argument to <code>--advance</code> to point at
795 the new commits (in other words, this mimics a cherry-pick operation).</p></div>
796 </dd>
797 <dt class="hdlist1">
798 &lt;revision-range&gt;
799 </dt>
800 <dd>
802 Range of commits to replay. More than one &lt;revision-range&gt; can
803 be passed, but in <code>--advance &lt;branch&gt;</code> mode, they should have
804 a single tip, so that it&#8217;s clear where &lt;branch&gt; should point
805 to. See "Specifying Ranges" in linkgit:git-rev-parse and the
806 "Commit Limiting" options below.
807 </p>
808 </dd>
809 </dl></div>
810 <div class="sect2">
811 <h3 id="_commit_limiting">Commit Limiting</h3>
812 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
813 special notations explained in the description, additional commit
814 limiting may be applied.</p></div>
815 <div class="paragraph"><p>Using more options generally further limits the output (e.g.
816 <code>--since=&lt;date1&gt;</code> limits to commits newer than <code>&lt;date1&gt;</code>, and using it
817 with <code>--grep=&lt;pattern&gt;</code> further limits to commits whose log message
818 has a line that matches <code>&lt;pattern&gt;</code>), unless otherwise noted.</p></div>
819 <div class="paragraph"><p>Note that these are applied before commit
820 ordering and formatting options, such as <code>--reverse</code>.</p></div>
821 <div class="dlist"><dl>
822 <dt class="hdlist1">
823 -&lt;number&gt;
824 </dt>
825 <dt class="hdlist1">
826 -n &lt;number&gt;
827 </dt>
828 <dt class="hdlist1">
829 --max-count=&lt;number&gt;
830 </dt>
831 <dd>
833 Limit the number of commits to output.
834 </p>
835 </dd>
836 <dt class="hdlist1">
837 --skip=&lt;number&gt;
838 </dt>
839 <dd>
841 Skip <em>number</em> commits before starting to show the commit output.
842 </p>
843 </dd>
844 <dt class="hdlist1">
845 --since=&lt;date&gt;
846 </dt>
847 <dt class="hdlist1">
848 --after=&lt;date&gt;
849 </dt>
850 <dd>
852 Show commits more recent than a specific date.
853 </p>
854 </dd>
855 <dt class="hdlist1">
856 --since-as-filter=&lt;date&gt;
857 </dt>
858 <dd>
860 Show all commits more recent than a specific date. This visits
861 all commits in the range, rather than stopping at the first commit which
862 is older than a specific date.
863 </p>
864 </dd>
865 <dt class="hdlist1">
866 --until=&lt;date&gt;
867 </dt>
868 <dt class="hdlist1">
869 --before=&lt;date&gt;
870 </dt>
871 <dd>
873 Show commits older than a specific date.
874 </p>
875 </dd>
876 <dt class="hdlist1">
877 --author=&lt;pattern&gt;
878 </dt>
879 <dt class="hdlist1">
880 --committer=&lt;pattern&gt;
881 </dt>
882 <dd>
884 Limit the commits output to ones with author/committer
885 header lines that match the specified pattern (regular
886 expression). With more than one <code>--author=&lt;pattern&gt;</code>,
887 commits whose author matches any of the given patterns are
888 chosen (similarly for multiple <code>--committer=&lt;pattern&gt;</code>).
889 </p>
890 </dd>
891 <dt class="hdlist1">
892 --grep-reflog=&lt;pattern&gt;
893 </dt>
894 <dd>
896 Limit the commits output to ones with reflog entries that
897 match the specified pattern (regular expression). With
898 more than one <code>--grep-reflog</code>, commits whose reflog message
899 matches any of the given patterns are chosen. It is an
900 error to use this option unless <code>--walk-reflogs</code> is in use.
901 </p>
902 </dd>
903 <dt class="hdlist1">
904 --grep=&lt;pattern&gt;
905 </dt>
906 <dd>
908 Limit the commits output to ones with a log message that
909 matches the specified pattern (regular expression). With
910 more than one <code>--grep=&lt;pattern&gt;</code>, commits whose message
911 matches any of the given patterns are chosen (but see
912 <code>--all-match</code>).
913 </p>
914 <div class="paragraph"><p>When <code>--notes</code> is in effect, the message from the notes is
915 matched as if it were part of the log message.</p></div>
916 </dd>
917 <dt class="hdlist1">
918 --all-match
919 </dt>
920 <dd>
922 Limit the commits output to ones that match all given <code>--grep</code>,
923 instead of ones that match at least one.
924 </p>
925 </dd>
926 <dt class="hdlist1">
927 --invert-grep
928 </dt>
929 <dd>
931 Limit the commits output to ones with a log message that do not
932 match the pattern specified with <code>--grep=&lt;pattern&gt;</code>.
933 </p>
934 </dd>
935 <dt class="hdlist1">
937 </dt>
938 <dt class="hdlist1">
939 --regexp-ignore-case
940 </dt>
941 <dd>
943 Match the regular expression limiting patterns without regard to letter
944 case.
945 </p>
946 </dd>
947 <dt class="hdlist1">
948 --basic-regexp
949 </dt>
950 <dd>
952 Consider the limiting patterns to be basic regular expressions;
953 this is the default.
954 </p>
955 </dd>
956 <dt class="hdlist1">
958 </dt>
959 <dt class="hdlist1">
960 --extended-regexp
961 </dt>
962 <dd>
964 Consider the limiting patterns to be extended regular expressions
965 instead of the default basic regular expressions.
966 </p>
967 </dd>
968 <dt class="hdlist1">
970 </dt>
971 <dt class="hdlist1">
972 --fixed-strings
973 </dt>
974 <dd>
976 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
977 pattern as a regular expression).
978 </p>
979 </dd>
980 <dt class="hdlist1">
982 </dt>
983 <dt class="hdlist1">
984 --perl-regexp
985 </dt>
986 <dd>
988 Consider the limiting patterns to be Perl-compatible regular
989 expressions.
990 </p>
991 <div class="paragraph"><p>Support for these types of regular expressions is an optional
992 compile-time dependency. If Git wasn&#8217;t compiled with support for them
993 providing this option will cause it to die.</p></div>
994 </dd>
995 <dt class="hdlist1">
996 --remove-empty
997 </dt>
998 <dd>
1000 Stop when a given path disappears from the tree.
1001 </p>
1002 </dd>
1003 <dt class="hdlist1">
1004 --merges
1005 </dt>
1006 <dd>
1008 Print only merge commits. This is exactly the same as <code>--min-parents=2</code>.
1009 </p>
1010 </dd>
1011 <dt class="hdlist1">
1012 --no-merges
1013 </dt>
1014 <dd>
1016 Do not print commits with more than one parent. This is
1017 exactly the same as <code>--max-parents=1</code>.
1018 </p>
1019 </dd>
1020 <dt class="hdlist1">
1021 --min-parents=&lt;number&gt;
1022 </dt>
1023 <dt class="hdlist1">
1024 --max-parents=&lt;number&gt;
1025 </dt>
1026 <dt class="hdlist1">
1027 --no-min-parents
1028 </dt>
1029 <dt class="hdlist1">
1030 --no-max-parents
1031 </dt>
1032 <dd>
1034 Show only commits which have at least (or at most) that many parent
1035 commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>,
1036 <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code>
1037 gives all root commits and <code>--min-parents=3</code> all octopus merges.
1038 </p>
1039 <div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit)
1040 again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more
1041 parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div>
1042 </dd>
1043 <dt class="hdlist1">
1044 --first-parent
1045 </dt>
1046 <dd>
1048 When finding commits to include, follow only the first
1049 parent commit upon seeing a merge commit. This option
1050 can give a better overview when viewing the evolution of
1051 a particular topic branch, because merges into a topic
1052 branch tend to be only about adjusting to updated upstream
1053 from time to time, and this option allows you to ignore
1054 the individual commits brought in to your history by such
1055 a merge.
1056 </p>
1057 </dd>
1058 <dt class="hdlist1">
1059 --exclude-first-parent-only
1060 </dt>
1061 <dd>
1063 When finding commits to exclude (with a <em>&#94;</em>), follow only
1064 the first parent commit upon seeing a merge commit.
1065 This can be used to find the set of changes in a topic branch
1066 from the point where it diverged from the remote branch, given
1067 that arbitrary merges can be valid topic branch changes.
1068 </p>
1069 </dd>
1070 <dt class="hdlist1">
1071 --not
1072 </dt>
1073 <dd>
1075 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
1076 for all following revision specifiers, up to the next <code>--not</code>.
1077 When used on the command line before --stdin, the revisions passed
1078 through stdin will not be affected by it. Conversely, when passed
1079 via standard input, the revisions passed on the command line will
1080 not be affected by it.
1081 </p>
1082 </dd>
1083 <dt class="hdlist1">
1084 --all
1085 </dt>
1086 <dd>
1088 Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are
1089 listed on the command line as <em>&lt;commit&gt;</em>.
1090 </p>
1091 </dd>
1092 <dt class="hdlist1">
1093 --branches[=&lt;pattern&gt;]
1094 </dt>
1095 <dd>
1097 Pretend as if all the refs in <code>refs/heads</code> are listed
1098 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1099 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
1100 <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1101 </p>
1102 </dd>
1103 <dt class="hdlist1">
1104 --tags[=&lt;pattern&gt;]
1105 </dt>
1106 <dd>
1108 Pretend as if all the refs in <code>refs/tags</code> are listed
1109 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1110 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>&#42;</em>,
1111 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1112 </p>
1113 </dd>
1114 <dt class="hdlist1">
1115 --remotes[=&lt;pattern&gt;]
1116 </dt>
1117 <dd>
1119 Pretend as if all the refs in <code>refs/remotes</code> are listed
1120 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
1121 remote-tracking branches to ones matching given shell glob.
1122 If pattern lacks <em>?</em>, <em>&#42;</em>, or <em>[</em>, <em>/&#42;</em> at the end is implied.
1123 </p>
1124 </dd>
1125 <dt class="hdlist1">
1126 --glob=&lt;glob-pattern&gt;
1127 </dt>
1128 <dd>
1130 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
1131 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
1132 is automatically prepended if missing. If pattern lacks <em>?</em>, <em>&#42;</em>,
1133 or <em>[</em>, <em>/&#42;</em> at the end is implied.
1134 </p>
1135 </dd>
1136 <dt class="hdlist1">
1137 --exclude=&lt;glob-pattern&gt;
1138 </dt>
1139 <dd>
1141 Do not include refs matching <em>&lt;glob-pattern&gt;</em> that the next <code>--all</code>,
1142 <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise
1143 consider. Repetitions of this option accumulate exclusion patterns
1144 up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or
1145 <code>--glob</code> option (other options or arguments do not clear
1146 accumulated patterns).
1147 </p>
1148 <div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or
1149 <code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>,
1150 respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code>
1151 or <code>--all</code>. If a trailing <em>/&#42;</em> is intended, it must be given
1152 explicitly.</p></div>
1153 </dd>
1154 <dt class="hdlist1">
1155 --exclude-hidden=[fetch|receive|uploadpack]
1156 </dt>
1157 <dd>
1159 Do not include refs that would be hidden by <code>git-fetch</code>,
1160 <code>git-receive-pack</code> or <code>git-upload-pack</code> by consulting the appropriate
1161 <code>fetch.hideRefs</code>, <code>receive.hideRefs</code> or <code>uploadpack.hideRefs</code>
1162 configuration along with <code>transfer.hideRefs</code> (see
1163 <a href="git-config.html">git-config(1)</a>). This option affects the next pseudo-ref option
1164 <code>--all</code> or <code>--glob</code> and is cleared after processing them.
1165 </p>
1166 </dd>
1167 <dt class="hdlist1">
1168 --reflog
1169 </dt>
1170 <dd>
1172 Pretend as if all objects mentioned by reflogs are listed on the
1173 command line as <code>&lt;commit&gt;</code>.
1174 </p>
1175 </dd>
1176 <dt class="hdlist1">
1177 --alternate-refs
1178 </dt>
1179 <dd>
1181 Pretend as if all objects mentioned as ref tips of alternate
1182 repositories were listed on the command line. An alternate
1183 repository is any repository whose object directory is specified
1184 in <code>objects/info/alternates</code>. The set of included objects may
1185 be modified by <code>core.alternateRefsCommand</code>, etc. See
1186 <a href="git-config.html">git-config(1)</a>.
1187 </p>
1188 </dd>
1189 <dt class="hdlist1">
1190 --single-worktree
1191 </dt>
1192 <dd>
1194 By default, all working trees will be examined by the
1195 following options when there are more than one (see
1196 <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and
1197 <code>--indexed-objects</code>.
1198 This option forces them to examine the current working tree
1199 only.
1200 </p>
1201 </dd>
1202 <dt class="hdlist1">
1203 --ignore-missing
1204 </dt>
1205 <dd>
1207 Upon seeing an invalid object name in the input, pretend as if
1208 the bad input was not given.
1209 </p>
1210 </dd>
1211 <dt class="hdlist1">
1212 --bisect
1213 </dt>
1214 <dd>
1216 Pretend as if the bad bisection ref <code>refs/bisect/bad</code>
1217 was listed and as if it was followed by <code>--not</code> and the good
1218 bisection refs <code>refs/bisect/good-*</code> on the command
1219 line.
1220 </p>
1221 </dd>
1222 <dt class="hdlist1">
1223 --stdin
1224 </dt>
1225 <dd>
1227 In addition to getting arguments from the command line, read
1228 them from standard input as well. This accepts commits and
1229 pseudo-options like <code>--all</code> and <code>--glob=</code>. When a <code>--</code> separator
1230 is seen, the following input is treated as paths and used to
1231 limit the result. Flags like <code>--not</code> which are read via standard input
1232 are only respected for arguments passed in the same way and will not
1233 influence any subsequent command line arguments.
1234 </p>
1235 </dd>
1236 <dt class="hdlist1">
1237 --cherry-mark
1238 </dt>
1239 <dd>
1241 Like <code>--cherry-pick</code> (see below) but mark equivalent commits
1242 with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>.
1243 </p>
1244 </dd>
1245 <dt class="hdlist1">
1246 --cherry-pick
1247 </dt>
1248 <dd>
1250 Omit any commit that introduces the same change as
1251 another commit on the &#8220;other side&#8221; when the set of
1252 commits are limited with symmetric difference.
1253 </p>
1254 <div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way
1255 to list all commits on only one side of them is with
1256 <code>--left-right</code> (see the example below in the description of
1257 the <code>--left-right</code> option). However, it shows the commits that were
1258 cherry-picked from the other branch (for example, &#8220;3rd on b&#8221; may be
1259 cherry-picked from branch A). With this option, such pairs of commits are
1260 excluded from the output.</p></div>
1261 </dd>
1262 <dt class="hdlist1">
1263 --left-only
1264 </dt>
1265 <dt class="hdlist1">
1266 --right-only
1267 </dt>
1268 <dd>
1270 List only commits on the respective side of a symmetric difference,
1271 i.e. only those which would be marked <code>&lt;</code> resp. <code>&gt;</code> by
1272 <code>--left-right</code>.
1273 </p>
1274 <div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those
1275 commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in
1276 <code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>.
1277 More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact
1278 list.</p></div>
1279 </dd>
1280 <dt class="hdlist1">
1281 --cherry
1282 </dt>
1283 <dd>
1285 A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to
1286 limit the output to the commits on our side and mark those that
1287 have been applied to the other side of a forked history with
1288 <code>git log --cherry upstream...mybranch</code>, similar to
1289 <code>git cherry upstream mybranch</code>.
1290 </p>
1291 </dd>
1292 <dt class="hdlist1">
1294 </dt>
1295 <dt class="hdlist1">
1296 --walk-reflogs
1297 </dt>
1298 <dd>
1300 Instead of walking the commit ancestry chain, walk
1301 reflog entries from the most recent one to older ones.
1302 When this option is used you cannot specify commits to
1303 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
1304 and <em>commit1...commit2</em> notations cannot be used).
1305 </p>
1306 <div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> and <code>reference</code> (for obvious reasons),
1307 this causes the output to have two extra lines of information
1308 taken from the reflog. The reflog designator in the output may be shown
1309 as <code>ref@{Nth}</code> (where <code>Nth</code> is the reverse-chronological index in the
1310 reflog) or as <code>ref@{timestamp}</code> (with the timestamp for that entry),
1311 depending on a few rules:</p></div>
1312 <div class="openblock">
1313 <div class="content">
1314 <div class="olist arabic"><ol class="arabic">
1315 <li>
1317 If the starting point is specified as <code>ref@{Nth}</code>, show the index
1318 format.
1319 </p>
1320 </li>
1321 <li>
1323 If the starting point was specified as <code>ref@{now}</code>, show the
1324 timestamp format.
1325 </p>
1326 </li>
1327 <li>
1329 If neither was used, but <code>--date</code> was given on the command line, show
1330 the timestamp in the format requested by <code>--date</code>.
1331 </p>
1332 </li>
1333 <li>
1335 Otherwise, show the index format.
1336 </p>
1337 </li>
1338 </ol></div>
1339 </div></div>
1340 <div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is
1341 prefixed with this information on the same line.
1342 This option cannot be combined with <code>--reverse</code>.
1343 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
1344 <div class="paragraph"><p>Under <code>--pretty=reference</code>, this information will not be shown at all.</p></div>
1345 </dd>
1346 <dt class="hdlist1">
1347 --merge
1348 </dt>
1349 <dd>
1351 After a failed merge, show refs that touch files having a
1352 conflict and don&#8217;t exist on all heads to merge.
1353 </p>
1354 </dd>
1355 <dt class="hdlist1">
1356 --boundary
1357 </dt>
1358 <dd>
1360 Output excluded boundary commits. Boundary commits are
1361 prefixed with <code>-</code>.
1362 </p>
1363 </dd>
1364 </dl></div>
1365 </div>
1366 <div class="sect2">
1367 <h3 id="_history_simplification">History Simplification</h3>
1368 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
1369 commits modifying a particular &lt;path&gt;. But there are two parts of
1370 <em>History Simplification</em>, one part is selecting the commits and the other
1371 is how to do it, as there are various strategies to simplify the history.</p></div>
1372 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1373 <div class="dlist"><dl>
1374 <dt class="hdlist1">
1375 &lt;paths&gt;
1376 </dt>
1377 <dd>
1379 Commits modifying the given &lt;paths&gt; are selected.
1380 </p>
1381 </dd>
1382 <dt class="hdlist1">
1383 --simplify-by-decoration
1384 </dt>
1385 <dd>
1387 Commits that are referred by some branch or tag are selected.
1388 </p>
1389 </dd>
1390 </dl></div>
1391 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1392 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1393 <div class="dlist"><dl>
1394 <dt class="hdlist1">
1395 Default mode
1396 </dt>
1397 <dd>
1399 Simplifies the history to the simplest history explaining the
1400 final state of the tree. Simplest because it prunes some side
1401 branches if the end result is the same (i.e. merging branches
1402 with the same content)
1403 </p>
1404 </dd>
1405 <dt class="hdlist1">
1406 --show-pulls
1407 </dt>
1408 <dd>
1410 Include all commits from the default mode, but also any merge
1411 commits that are not TREESAME to the first parent but are
1412 TREESAME to a later parent. This mode is helpful for showing
1413 the merge commits that "first introduced" a change to a branch.
1414 </p>
1415 </dd>
1416 <dt class="hdlist1">
1417 --full-history
1418 </dt>
1419 <dd>
1421 Same as the default mode, but does not prune some history.
1422 </p>
1423 </dd>
1424 <dt class="hdlist1">
1425 --dense
1426 </dt>
1427 <dd>
1429 Only the selected commits are shown, plus some to have a
1430 meaningful history.
1431 </p>
1432 </dd>
1433 <dt class="hdlist1">
1434 --sparse
1435 </dt>
1436 <dd>
1438 All commits in the simplified history are shown.
1439 </p>
1440 </dd>
1441 <dt class="hdlist1">
1442 --simplify-merges
1443 </dt>
1444 <dd>
1446 Additional option to <code>--full-history</code> to remove some needless
1447 merges from the resulting history, as there are no selected
1448 commits contributing to this merge.
1449 </p>
1450 </dd>
1451 <dt class="hdlist1">
1452 --ancestry-path[=&lt;commit&gt;]
1453 </dt>
1454 <dd>
1456 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1457 or <em>commit2 &#94;commit1</em>), only display commits in that range
1458 that are ancestors of &lt;commit&gt;, descendants of &lt;commit&gt;, or
1459 &lt;commit&gt; itself. If no commit is specified, use <em>commit1</em> (the
1460 excluded part of the range) as &lt;commit&gt;. Can be passed multiple
1461 times; if so, a commit is included if it is any of the commits
1462 given or if it is an ancestor or descendant of one of them.
1463 </p>
1464 </dd>
1465 </dl></div>
1466 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
1467 <div class="paragraph"><p>Suppose you specified <code>foo</code> as the &lt;paths&gt;. We shall call commits
1468 that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff
1469 filtered for <code>foo</code>, they look different and equal, respectively.)</p></div>
1470 <div class="paragraph"><p>In the following, we will always refer to the same example history to
1471 illustrate the differences between simplification settings. We assume
1472 that you are filtering for a file <code>foo</code> in this commit graph:</p></div>
1473 <div class="listingblock">
1474 <div class="content">
1475 <pre><code> .-A---M---N---O---P---Q
1476 / / / / / /
1477 I B C D E Y
1478 \ / / / / /
1479 `-------------' X</code></pre>
1480 </div></div>
1481 <div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of
1482 each merge. The commits are:</p></div>
1483 <div class="ulist"><ul>
1484 <li>
1486 <code>I</code> is the initial commit, in which <code>foo</code> exists with contents
1487 &#8220;asdf&#8221;, and a file <code>quux</code> exists with contents &#8220;quux&#8221;. Initial
1488 commits are compared to an empty tree, so <code>I</code> is !TREESAME.
1489 </p>
1490 </li>
1491 <li>
1493 In <code>A</code>, <code>foo</code> contains just &#8220;foo&#8221;.
1494 </p>
1495 </li>
1496 <li>
1498 <code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and
1499 hence TREESAME to all parents.
1500 </p>
1501 </li>
1502 <li>
1504 <code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to &#8220;foobar&#8221;,
1505 so it is not TREESAME to any parent.
1506 </p>
1507 </li>
1508 <li>
1510 <code>D</code> sets <code>foo</code> to &#8220;baz&#8221;. Its merge <code>O</code> combines the strings from
1511 <code>N</code> and <code>D</code> to &#8220;foobarbaz&#8221;; i.e., it is not TREESAME to any parent.
1512 </p>
1513 </li>
1514 <li>
1516 <code>E</code> changes <code>quux</code> to &#8220;xyzzy&#8221;, and its merge <code>P</code> combines the
1517 strings to &#8220;quux xyzzy&#8221;. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>.
1518 </p>
1519 </li>
1520 <li>
1522 <code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code>
1523 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
1524 <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>.
1525 </p>
1526 </li>
1527 </ul></div>
1528 <div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding
1529 commits based on whether <code>--full-history</code> and/or parent rewriting
1530 (via <code>--parents</code> or <code>--children</code>) are used. The following settings
1531 are available.</p></div>
1532 <div class="dlist"><dl>
1533 <dt class="hdlist1">
1534 Default mode
1535 </dt>
1536 <dd>
1538 Commits are included if they are not TREESAME to any parent
1539 (though this can be changed, see <code>--sparse</code> below). If the
1540 commit was a merge, and it was TREESAME to one parent, follow
1541 only that parent. (Even if there are several TREESAME
1542 parents, follow only one of them.) Otherwise, follow all
1543 parents.
1544 </p>
1545 <div class="paragraph"><p>This results in:</p></div>
1546 <div class="listingblock">
1547 <div class="content">
1548 <pre><code> .-A---N---O
1549 / / /
1550 I---------D</code></pre>
1551 </div></div>
1552 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1553 available, removed <code>B</code> from consideration entirely. <code>C</code> was
1554 considered via <code>N</code>, but is TREESAME. Root commits are compared to an
1555 empty tree, so <code>I</code> is !TREESAME.</p></div>
1556 <div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does
1557 not affect the commits selected in default mode, so we have shown the
1558 parent lines.</p></div>
1559 </dd>
1560 <dt class="hdlist1">
1561 --full-history without parent rewriting
1562 </dt>
1563 <dd>
1565 This mode differs from the default in one point: always follow
1566 all parents of a merge, even if it is TREESAME to one of them.
1567 Even if more than one side of the merge has commits that are
1568 included, this does not imply that the merge itself is! In
1569 the example, we get
1570 </p>
1571 <div class="listingblock">
1572 <div class="content">
1573 <pre><code> I A B N D O P Q</code></pre>
1574 </div></div>
1575 <div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>,
1576 <code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others
1577 do not appear.</p></div>
1578 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1579 about the parent/child relationships between the commits, so we show
1580 them disconnected.</p></div>
1581 </dd>
1582 <dt class="hdlist1">
1583 --full-history with parent rewriting
1584 </dt>
1585 <dd>
1587 Ordinary commits are only included if they are !TREESAME
1588 (though this can be changed, see <code>--sparse</code> below).
1589 </p>
1590 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1591 Along each parent, prune away commits that are not included
1592 themselves. This results in</p></div>
1593 <div class="listingblock">
1594 <div class="content">
1595 <pre><code> .-A---M---N---O---P---Q
1596 / / / / /
1597 I B / D /
1598 \ / / / /
1599 `-------------'</code></pre>
1600 </div></div>
1601 <div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code>
1602 was pruned away because it is TREESAME, but the parent list of P was
1603 rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and
1604 <code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div>
1605 </dd>
1606 </dl></div>
1607 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1608 affects inclusion:</p></div>
1609 <div class="dlist"><dl>
1610 <dt class="hdlist1">
1611 --dense
1612 </dt>
1613 <dd>
1615 Commits that are walked are included if they are not TREESAME
1616 to any parent.
1617 </p>
1618 </dd>
1619 <dt class="hdlist1">
1620 --sparse
1621 </dt>
1622 <dd>
1624 All commits that are walked are included.
1625 </p>
1626 <div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if
1627 one of the parents is TREESAME, we follow only that one, so the other
1628 sides of the merge are never walked.</p></div>
1629 </dd>
1630 <dt class="hdlist1">
1631 --simplify-merges
1632 </dt>
1633 <dd>
1635 First, build a history graph in the same way that
1636 <code>--full-history</code> with parent rewriting does (see above).
1637 </p>
1638 <div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final
1639 history according to the following rules:</p></div>
1640 <div class="openblock">
1641 <div class="content">
1642 <div class="ulist"><ul>
1643 <li>
1645 Set <code>C'</code> to <code>C</code>.
1646 </p>
1647 </li>
1648 <li>
1650 Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In
1651 the process, drop parents that are ancestors of other parents or that are
1652 root commits TREESAME to an empty tree, and remove duplicates, but take care
1653 to never drop all parents that we are TREESAME to.
1654 </p>
1655 </li>
1656 <li>
1658 If after this parent rewriting, <code>C'</code> is a root or merge commit (has
1659 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1660 Otherwise, it is replaced with its only parent.
1661 </p>
1662 </li>
1663 </ul></div>
1664 </div></div>
1665 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1666 <code>--full-history</code> with parent rewriting. The example turns into:</p></div>
1667 <div class="listingblock">
1668 <div class="content">
1669 <pre><code> .-A---M---N---O
1670 / / /
1671 I B D
1672 \ / /
1673 `---------'</code></pre>
1674 </div></div>
1675 <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>
1676 <div class="openblock">
1677 <div class="content">
1678 <div class="ulist"><ul>
1679 <li>
1681 <code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the
1682 other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME.
1683 </p>
1684 </li>
1685 <li>
1687 <code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then
1688 removed completely, because it had one parent and is TREESAME.
1689 </p>
1690 </li>
1691 <li>
1693 <code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it
1694 was a TREESAME root. <code>Q</code> was then removed completely, because it had one
1695 parent and is TREESAME.
1696 </p>
1697 </li>
1698 </ul></div>
1699 </div></div>
1700 </dd>
1701 </dl></div>
1702 <div class="paragraph"><p>There is another simplification mode available:</p></div>
1703 <div class="dlist"><dl>
1704 <dt class="hdlist1">
1705 --ancestry-path[=&lt;commit&gt;]
1706 </dt>
1707 <dd>
1709 Limit the displayed commits to those which are an ancestor of
1710 &lt;commit&gt;, or which are a descendant of &lt;commit&gt;, or are &lt;commit&gt;
1711 itself.
1712 </p>
1713 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1714 <div class="listingblock">
1715 <div class="content">
1716 <pre><code> D---E-------F
1717 / \ \
1718 B---C---G---H---I---J
1720 A-------K---------------L--M</code></pre>
1721 </div></div>
1722 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>,
1723 but excludes the ones that are ancestors of <code>D</code>. This is useful to see
1724 what happened to the history leading to <code>M</code> since <code>D</code>, in the sense
1725 that &#8220;what does <code>M</code> have that did not exist in <code>D</code>&#8221;. The result in this
1726 example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself,
1727 of course).</p></div>
1728 <div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the
1729 bug introduced by <code>D</code> and need fixing, however, we might want to view
1730 only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e.
1731 excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code>
1732 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1733 <div class="listingblock">
1734 <div class="content">
1735 <pre><code> E-------F
1737 G---H---I---J
1739 L--M</code></pre>
1740 </div></div>
1741 <div class="paragraph"><p>We can also use <code>--ancestry-path=D</code> instead of <code>--ancestry-path</code> which
1742 means the same thing when applied to the <em>D..M</em> range but is just more
1743 explicit.</p></div>
1744 <div class="paragraph"><p>If we instead are interested in a given topic within this range, and all
1745 commits affected by that topic, we may only want to view the subset of
1746 <code>D..M</code> which contain that topic in their ancestry path. So, using
1747 <code>--ancestry-path=H D..M</code> for example would result in:</p></div>
1748 <div class="listingblock">
1749 <div class="content">
1750 <pre><code> E
1752 G---H---I---J
1754 L--M</code></pre>
1755 </div></div>
1756 <div class="paragraph"><p>Whereas <code>--ancestry-path=K D..M</code> would result in</p></div>
1757 <div class="listingblock">
1758 <div class="content">
1759 <pre><code> K---------------L--M</code></pre>
1760 </div></div>
1761 </dd>
1762 </dl></div>
1763 <div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to
1764 create a new example history.</p></div>
1765 <div class="paragraph"><p>A common problem users face when looking at simplified history is that a
1766 commit they know changed a file somehow does not appear in the file&#8217;s
1767 simplified history. Let&#8217;s demonstrate a new example and show how options
1768 such as <code>--full-history</code> and <code>--simplify-merges</code> works in that case:</p></div>
1769 <div class="listingblock">
1770 <div class="content">
1771 <pre><code> .-A---M-----C--N---O---P
1772 / / \ \ \/ / /
1773 I B \ R-'`-Z' /
1774 \ / \/ /
1775 \ / /\ /
1776 `---X--' `---Y--'</code></pre>
1777 </div></div>
1778 <div class="paragraph"><p>For this example, suppose <code>I</code> created <code>file.txt</code> which was modified by
1779 <code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>,
1780 and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by
1781 resolving the merge conflict to include both changes from <code>A</code> and <code>B</code>
1782 and hence is not TREESAME to either. The merge commit <code>R</code>, however, was
1783 created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only
1784 the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not
1785 <code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the
1786 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>.
1787 The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but
1788 not to their second parents, <code>Z</code> and <code>Y</code> respectively.</p></div>
1789 <div class="paragraph"><p>When using the default mode, <code>N</code> and <code>R</code> both have a TREESAME parent, so
1790 those edges are walked and the others are ignored. The resulting history
1791 graph is:</p></div>
1792 <div class="listingblock">
1793 <div class="content">
1794 <pre><code> I---X</code></pre>
1795 </div></div>
1796 <div class="paragraph"><p>When using <code>--full-history</code>, Git walks every edge. This will discover
1797 the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the
1798 merge commits <code>O</code> and <code>P</code>. With parent rewriting, the resulting graph is:</p></div>
1799 <div class="listingblock">
1800 <div class="content">
1801 <pre><code> .-A---M--------N---O---P
1802 / / \ \ \/ / /
1803 I B \ R-'`--' /
1804 \ / \/ /
1805 \ / /\ /
1806 `---X--' `------'</code></pre>
1807 </div></div>
1808 <div class="paragraph"><p>Here, the merge commits <code>O</code> and <code>P</code> contribute extra noise, as they did
1809 not actually contribute a change to <code>file.txt</code>. They only merged a topic
1810 that was based on an older version of <code>file.txt</code>. This is a common
1811 issue in repositories using a workflow where many contributors work in
1812 parallel and merge their topic branches along a single trunk: many
1813 unrelated merges appear in the <code>--full-history</code> results.</p></div>
1814 <div class="paragraph"><p>When using the <code>--simplify-merges</code> option, the commits <code>O</code> and <code>P</code>
1815 disappear from the results. This is because the rewritten second parents
1816 of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are
1817 removed and then the commits look like single-parent commits that are
1818 TREESAME to their parent. This also happens to the commit <code>N</code>, resulting
1819 in a history view as follows:</p></div>
1820 <div class="listingblock">
1821 <div class="content">
1822 <pre><code> .-A---M--.
1823 / / \
1824 I B R
1825 \ / /
1826 \ / /
1827 `---X--'</code></pre>
1828 </div></div>
1829 <div class="paragraph"><p>In this view, we see all of the important single-parent changes from
1830 <code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the
1831 not-so-carefully-resolved merge <code>R</code>. This is usually enough information
1832 to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in
1833 the default view. However, there are a few issues with this approach.</p></div>
1834 <div class="paragraph"><p>The first issue is performance. Unlike any previous option, the
1835 <code>--simplify-merges</code> option requires walking the entire commit history
1836 before returning a single result. This can make the option difficult to
1837 use for very large repositories.</p></div>
1838 <div class="paragraph"><p>The second issue is one of auditing. When many contributors are working
1839 on the same repository, it is important which merge commits introduced
1840 a change into an important branch. The problematic merge <code>R</code> above is
1841 not likely to be the merge commit that was used to merge into an
1842 important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code>
1843 into the important branch. This commit may have information about why
1844 the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its
1845 commit message.</p></div>
1846 <div class="dlist"><dl>
1847 <dt class="hdlist1">
1848 --show-pulls
1849 </dt>
1850 <dd>
1852 In addition to the commits shown in the default history, show
1853 each merge commit that is not TREESAME to its first parent but
1854 is TREESAME to a later parent.
1855 </p>
1856 <div class="paragraph"><p>When a merge commit is included by <code>--show-pulls</code>, the merge is
1857 treated as if it "pulled" the change from another branch. When using
1858 <code>--show-pulls</code> on this example (and no other options) the resulting
1859 graph is:</p></div>
1860 <div class="listingblock">
1861 <div class="content">
1862 <pre><code> I---X---R---N</code></pre>
1863 </div></div>
1864 <div class="paragraph"><p>Here, the merge commits <code>R</code> and <code>N</code> are included because they pulled
1865 the commits <code>X</code> and <code>R</code> into the base branch, respectively. These
1866 merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the
1867 default history.</p></div>
1868 <div class="paragraph"><p>When <code>--show-pulls</code> is paired with <code>--simplify-merges</code>, the
1869 graph includes all of the necessary information:</p></div>
1870 <div class="listingblock">
1871 <div class="content">
1872 <pre><code> .-A---M--. N
1873 / / \ /
1874 I B R
1875 \ / /
1876 \ / /
1877 `---X--'</code></pre>
1878 </div></div>
1879 <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>
1880 was simplified away. However, <code>N</code> still appears in the history as an
1881 important commit because it "pulled" the change <code>R</code> into the main
1882 branch.</p></div>
1883 </dd>
1884 </dl></div>
1885 <div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the
1886 big picture of the topology of the history, by omitting commits
1887 that are not referenced by tags. Commits are marked as !TREESAME
1888 (in other words, kept after history simplification rules described
1889 above) if (1) they are referenced by tags, or (2) they change the
1890 contents of the paths given on the command line. All other
1891 commits are marked as TREESAME (subject to be simplified away).</p></div>
1892 </div>
1893 <div class="sect2">
1894 <h3 id="_commit_ordering">Commit Ordering</h3>
1895 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1896 <div class="dlist"><dl>
1897 <dt class="hdlist1">
1898 --date-order
1899 </dt>
1900 <dd>
1902 Show no parents before all of its children are shown, but
1903 otherwise show commits in the commit timestamp order.
1904 </p>
1905 </dd>
1906 <dt class="hdlist1">
1907 --author-date-order
1908 </dt>
1909 <dd>
1911 Show no parents before all of its children are shown, but
1912 otherwise show commits in the author timestamp order.
1913 </p>
1914 </dd>
1915 <dt class="hdlist1">
1916 --topo-order
1917 </dt>
1918 <dd>
1920 Show no parents before all of its children are shown, and
1921 avoid showing commits on multiple lines of history
1922 intermixed.
1923 </p>
1924 <div class="paragraph"><p>For example, in a commit history like this:</p></div>
1925 <div class="listingblock">
1926 <div class="content">
1927 <pre><code> ---1----2----4----7
1929 3----5----6----8---</code></pre>
1930 </div></div>
1931 <div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git
1932 rev-list</code> and friends with <code>--date-order</code> show the commits in the
1933 timestamp order: 8 7 6 5 4 3 2 1.</p></div>
1934 <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
1935 3 1); some older commits are shown before newer ones in order to
1936 avoid showing the commits from two parallel development track mixed
1937 together.</p></div>
1938 </dd>
1939 <dt class="hdlist1">
1940 --reverse
1941 </dt>
1942 <dd>
1944 Output the commits chosen to be shown (see Commit Limiting
1945 section above) in reverse order. Cannot be combined with
1946 <code>--walk-reflogs</code>.
1947 </p>
1948 </dd>
1949 </dl></div>
1950 </div>
1951 <div class="sect2">
1952 <h3 id="_object_traversal">Object Traversal</h3>
1953 <div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div>
1954 <div class="dlist"><dl>
1955 <dt class="hdlist1">
1956 --no-walk[=(sorted|unsorted)]
1957 </dt>
1958 <dd>
1960 Only show the given commits, but do not traverse their ancestors.
1961 This has no effect if a range is specified. If the argument
1962 <code>unsorted</code> is given, the commits are shown in the order they were
1963 given on the command line. Otherwise (if <code>sorted</code> or no argument
1964 was given), the commits are shown in reverse chronological order
1965 by commit time.
1966 Cannot be combined with <code>--graph</code>.
1967 </p>
1968 </dd>
1969 <dt class="hdlist1">
1970 --do-walk
1971 </dt>
1972 <dd>
1974 Overrides a previous <code>--no-walk</code>.
1975 </p>
1976 </dd>
1977 </dl></div>
1978 </div>
1979 <div class="sect2">
1980 <h3 id="_commit_formatting">Commit Formatting</h3>
1981 <div class="dlist"><dl>
1982 <dt class="hdlist1">
1983 --pretty[=&lt;format&gt;]
1984 </dt>
1985 <dt class="hdlist1">
1986 --format=&lt;format&gt;
1987 </dt>
1988 <dd>
1990 Pretty-print the contents of the commit logs in a given format,
1991 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1992 <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
1993 and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
1994 and has <em>%placeholder</em> in it, it acts as if
1995 <em>--pretty=tformat:&lt;format&gt;</em> were given.
1996 </p>
1997 <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each
1998 format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p></div>
1999 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
2000 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
2001 </dd>
2002 <dt class="hdlist1">
2003 --abbrev-commit
2004 </dt>
2005 <dd>
2007 Instead of showing the full 40-byte hexadecimal commit object
2008 name, show a prefix that names the object uniquely.
2009 "--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
2010 option can be used to specify the minimum length of the prefix.
2011 </p>
2012 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
2013 people using 80-column terminals.</p></div>
2014 </dd>
2015 <dt class="hdlist1">
2016 --no-abbrev-commit
2017 </dt>
2018 <dd>
2020 Show the full 40-byte hexadecimal commit object name. This negates
2021 <code>--abbrev-commit</code>, either explicit or implied by other options such
2022 as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.
2023 </p>
2024 </dd>
2025 <dt class="hdlist1">
2026 --oneline
2027 </dt>
2028 <dd>
2030 This is a shorthand for "--pretty=oneline --abbrev-commit"
2031 used together.
2032 </p>
2033 </dd>
2034 <dt class="hdlist1">
2035 --encoding=&lt;encoding&gt;
2036 </dt>
2037 <dd>
2039 Commit objects record the character encoding used for the log message
2040 in their encoding header; this option can be used to tell the
2041 command to re-code the commit log message in the encoding
2042 preferred by the user. For non plumbing commands this
2043 defaults to UTF-8. Note that if an object claims to be encoded
2044 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2045 verbatim; this means that invalid sequences in the original
2046 commit may be copied to the output. Likewise, if iconv(3) fails
2047 to convert the commit, we will quietly output the original
2048 object verbatim.
2049 </p>
2050 </dd>
2051 <dt class="hdlist1">
2052 --expand-tabs=&lt;n&gt;
2053 </dt>
2054 <dt class="hdlist1">
2055 --expand-tabs
2056 </dt>
2057 <dt class="hdlist1">
2058 --no-expand-tabs
2059 </dt>
2060 <dd>
2062 Perform a tab expansion (replace each tab with enough spaces
2063 to fill to the next display column that is a multiple of <em>&lt;n&gt;</em>)
2064 in the log message before showing it in the output.
2065 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2066 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2067 which disables tab expansion.
2068 </p>
2069 <div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2070 message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2071 and <em>fuller</em>).</p></div>
2072 </dd>
2073 <dt class="hdlist1">
2074 --notes[=&lt;ref&gt;]
2075 </dt>
2076 <dd>
2078 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
2079 commit, when showing the commit log message. This is the default
2080 for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
2081 there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
2082 on the command line.
2083 </p>
2084 <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
2085 <code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
2086 environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
2087 <div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, use the ref to find the notes
2088 to display. The ref can specify the full refname when it begins
2089 with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
2090 <code>refs/notes/</code> is prefixed to form the full name of the ref.</p></div>
2091 <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
2092 being displayed. Examples: "--notes=foo" will show only notes from
2093 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
2094 "refs/notes/foo" and from the default notes ref(s).</p></div>
2095 </dd>
2096 <dt class="hdlist1">
2097 --no-notes
2098 </dt>
2099 <dd>
2101 Do not show notes. This negates the above <code>--notes</code> option, by
2102 resetting the list of notes refs from which notes are shown.
2103 Options are parsed in the order given on the command line, so e.g.
2104 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2105 from "refs/notes/bar".
2106 </p>
2107 </dd>
2108 <dt class="hdlist1">
2109 --show-notes-by-default
2110 </dt>
2111 <dd>
2113 Show the default notes unless options for displaying specific
2114 notes are given.
2115 </p>
2116 </dd>
2117 <dt class="hdlist1">
2118 --show-notes[=&lt;ref&gt;]
2119 </dt>
2120 <dt class="hdlist1">
2121 --[no-]standard-notes
2122 </dt>
2123 <dd>
2125 These options are deprecated. Use the above --notes/--no-notes
2126 options instead.
2127 </p>
2128 </dd>
2129 <dt class="hdlist1">
2130 --show-signature
2131 </dt>
2132 <dd>
2134 Check the validity of a signed commit object by passing the signature
2135 to <code>gpg --verify</code> and show the output.
2136 </p>
2137 </dd>
2138 <dt class="hdlist1">
2139 --relative-date
2140 </dt>
2141 <dd>
2143 Synonym for <code>--date=relative</code>.
2144 </p>
2145 </dd>
2146 <dt class="hdlist1">
2147 --date=&lt;format&gt;
2148 </dt>
2149 <dd>
2151 Only takes effect for dates shown in human-readable format, such
2152 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
2153 value for the log command&#8217;s <code>--date</code> option. By default, dates
2154 are shown in the original time zone (either committer&#8217;s or
2155 author&#8217;s). If <code>-local</code> is appended to the format (e.g.,
2156 <code>iso-local</code>), the user&#8217;s local time zone is used instead.
2157 </p>
2158 <div class="openblock">
2159 <div class="content">
2160 <div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time,
2161 e.g. &#8220;2 hours ago&#8221;. The <code>-local</code> option has no effect for
2162 <code>--date=relative</code>.</p></div>
2163 <div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div>
2164 <div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2165 The differences to the strict ISO 8601 format are:</p></div>
2166 <div class="ulist"><ul>
2167 <li>
2169 a space instead of the <code>T</code> date/time delimiter
2170 </p>
2171 </li>
2172 <li>
2174 a space between time and time zone
2175 </p>
2176 </li>
2177 <li>
2179 no colon between hours and minutes of the time zone
2180 </p>
2181 </li>
2182 </ul></div>
2183 <div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2184 ISO 8601 format.</p></div>
2185 <div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
2186 format, often found in email messages.</p></div>
2187 <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>
2188 <div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
2189 00:00:00 UTC), followed by a space, and then the timezone as an offset
2190 from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2191 the second two are minutes). I.e., as if the timestamp were formatted
2192 with <code>strftime("%s %z")</code>).
2193 Note that the <code>-local</code> option does not affect the seconds-since-epoch
2194 value (which is always measured in UTC), but does switch the accompanying
2195 timezone value.</p></div>
2196 <div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the
2197 current time-zone, and doesn&#8217;t print the whole date if that matches
2198 (ie skip printing year for dates that are "this year", but also skip
2199 the whole date itself if it&#8217;s in the last few days and we can just say
2200 what weekday it was). For older dates the hour and minute is also
2201 omitted.</p></div>
2202 <div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
2203 1970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2204 has no effect.</p></div>
2205 <div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
2206 except for %s, %z, and %Z, which are handled internally.
2207 Use <code>--date=format:%c</code> to show the date in your system locale&#8217;s
2208 preferred format. See the <code>strftime</code> manual for a complete list of
2209 format placeholders. When using <code>-local</code>, the correct syntax is
2210 <code>--date=format-local:...</code>.</p></div>
2211 <div class="paragraph"><p><code>--date=default</code> is the default format, and is based on ctime(3)
2212 output. It shows a single line with three-letter day of the week,
2213 three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS"
2214 format, followed by 4-digit year, plus timezone information, unless
2215 the local time zone is used, e.g. <code>Thu Jan 1 00:00:00 1970 +0000</code>.</p></div>
2216 </div></div>
2217 </dd>
2218 <dt class="hdlist1">
2219 --parents
2220 </dt>
2221 <dd>
2223 Print also the parents of the commit (in the form "commit parent&#8230;").
2224 Also enables parent rewriting, see <em>History Simplification</em> above.
2225 </p>
2226 </dd>
2227 <dt class="hdlist1">
2228 --children
2229 </dt>
2230 <dd>
2232 Print also the children of the commit (in the form "commit child&#8230;").
2233 Also enables parent rewriting, see <em>History Simplification</em> above.
2234 </p>
2235 </dd>
2236 <dt class="hdlist1">
2237 --left-right
2238 </dt>
2239 <dd>
2241 Mark which side of a symmetric difference a commit is reachable from.
2242 Commits from the left side are prefixed with <code>&lt;</code> and those from
2243 the right with <code>&gt;</code>. If combined with <code>--boundary</code>, those
2244 commits are prefixed with <code>-</code>.
2245 </p>
2246 <div class="paragraph"><p>For example, if you have this topology:</p></div>
2247 <div class="listingblock">
2248 <div class="content">
2249 <pre><code> y---b---b branch B
2250 / \ /
2252 / / \
2253 o---x---a---a branch A</code></pre>
2254 </div></div>
2255 <div class="paragraph"><p>you would get an output like this:</p></div>
2256 <div class="listingblock">
2257 <div class="content">
2258 <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
2260 &gt;bbbbbbb... 3rd on b
2261 &gt;bbbbbbb... 2nd on b
2262 &lt;aaaaaaa... 3rd on a
2263 &lt;aaaaaaa... 2nd on a
2264 -yyyyyyy... 1st on b
2265 -xxxxxxx... 1st on a</code></pre>
2266 </div></div>
2267 </dd>
2268 <dt class="hdlist1">
2269 --graph
2270 </dt>
2271 <dd>
2273 Draw a text-based graphical representation of the commit history
2274 on the left hand side of the output. This may cause extra lines
2275 to be printed in between commits, in order for the graph history
2276 to be drawn properly.
2277 Cannot be combined with <code>--no-walk</code>.
2278 </p>
2279 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
2280 <div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the
2281 <code>--date-order</code> option may also be specified.</p></div>
2282 </dd>
2283 <dt class="hdlist1">
2284 --show-linear-break[=&lt;barrier&gt;]
2285 </dt>
2286 <dd>
2288 When --graph is not used, all history branches are flattened
2289 which can make it hard to see that the two consecutive commits
2290 do not belong to a linear branch. This option puts a barrier
2291 in between them in that case. If <code>&lt;barrier&gt;</code> is specified, it
2292 is the string that will be shown instead of the default one.
2293 </p>
2294 </dd>
2295 </dl></div>
2296 </div>
2297 </div>
2298 </div>
2299 <div class="sect1">
2300 <h2 id="_output">OUTPUT</h2>
2301 <div class="sectionbody">
2302 <div class="paragraph"><p>When there are no conflicts, the output of this command is usable as
2303 input to <code>git update-ref --stdin</code>. It is of the form:</p></div>
2304 <div class="literalblock">
2305 <div class="content">
2306 <pre><code>update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
2307 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
2308 update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}</code></pre>
2309 </div></div>
2310 <div class="paragraph"><p>where the number of refs updated depends on the arguments passed and
2311 the shape of the history being replayed. When using <code>--advance</code>, the
2312 number of refs updated is always one, but for <code>--onto</code>, it can be one
2313 or more (rebasing multiple branches simultaneously is supported).</p></div>
2314 </div>
2315 </div>
2316 <div class="sect1">
2317 <h2 id="_exit_status">EXIT STATUS</h2>
2318 <div class="sectionbody">
2319 <div class="paragraph"><p>For a successful, non-conflicted replay, the exit status is 0. When
2320 the replay has conflicts, the exit status is 1. If the replay is not
2321 able to complete (or start) due to some kind of error, the exit status
2322 is something other than 0 or 1.</p></div>
2323 </div>
2324 </div>
2325 <div class="sect1">
2326 <h2 id="_examples">EXAMPLES</h2>
2327 <div class="sectionbody">
2328 <div class="paragraph"><p>To simply rebase <code>mybranch</code> onto <code>target</code>:</p></div>
2329 <div class="listingblock">
2330 <div class="content">
2331 <pre><code>$ git replay --onto target origin/main..mybranch
2332 update refs/heads/mybranch ${NEW_mybranch_HASH} ${OLD_mybranch_HASH}</code></pre>
2333 </div></div>
2334 <div class="paragraph"><p>To cherry-pick the commits from mybranch onto target:</p></div>
2335 <div class="listingblock">
2336 <div class="content">
2337 <pre><code>$ git replay --advance target origin/main..mybranch
2338 update refs/heads/target ${NEW_target_HASH} ${OLD_target_HASH}</code></pre>
2339 </div></div>
2340 <div class="paragraph"><p>Note that the first two examples replay the exact same commits and on
2341 top of the exact same new base, they only differ in that the first
2342 provides instructions to make mybranch point at the new commits and
2343 the second provides instructions to make target point at them.</p></div>
2344 <div class="paragraph"><p>What if you have a stack of branches, one depending upon another, and
2345 you&#8217;d really like to rebase the whole set?</p></div>
2346 <div class="listingblock">
2347 <div class="content">
2348 <pre><code>$ git replay --contained --onto origin/main origin/main..tipbranch
2349 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
2350 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
2351 update refs/heads/tipbranch ${NEW_tipbranch_HASH} ${OLD_tipbranch_HASH}</code></pre>
2352 </div></div>
2353 <div class="paragraph"><p>When calling <code>git replay</code>, one does not need to specify a range of
2354 commits to replay using the syntax <code>A..B</code>; any range expression will
2355 do:</p></div>
2356 <div class="listingblock">
2357 <div class="content">
2358 <pre><code>$ git replay --onto origin/main ^base branch1 branch2 branch3
2359 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
2360 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
2361 update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}</code></pre>
2362 </div></div>
2363 <div class="paragraph"><p>This will simultaneously rebase <code>branch1</code>, <code>branch2</code>, and <code>branch3</code>,
2364 all commits they have since <code>base</code>, playing them on top of
2365 <code>origin/main</code>. These three branches may have commits on top of <code>base</code>
2366 that they have in common, but that does not need to be the case.</p></div>
2367 </div>
2368 </div>
2369 <div class="sect1">
2370 <h2 id="_git">GIT</h2>
2371 <div class="sectionbody">
2372 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2373 </div>
2374 </div>
2375 </div>
2376 <div id="footnotes"><hr /></div>
2377 <div id="footer">
2378 <div id="footer-text">
2379 Last updated
2380 2023-12-18 14:49:41 PST
2381 </div>
2382 </div>
2383 </body>
2384 </html>