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">
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-rev-list(
1)
</title>
9 <style type=
"text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.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 {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
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; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
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 {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
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; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
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;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
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 {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-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;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
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
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 */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
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
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);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
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");
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.
651 var noteholder = document.getElementById(
"footnotes");
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");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-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];
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;
692 noteholder.parentNode.removeChild(noteholder);
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.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 git-rev-list(
1) Manual Page
741 <div class=
"sectionbody">
743 Lists commit objects in reverse chronological order
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"verseblock">
752 <pre class=
"content"><em>git rev-list
</em> [
<options
>]
<commit
>… [--] [
<path
>…]
</pre>
753 <div class=
"attribution">
758 <h2 id=
"_description">DESCRIPTION
</h2>
759 <div class=
"sectionbody">
760 <div class=
"paragraph"><p>List commits that are reachable by following the
<code>parent
</code> links from the
761 given commit(s), but exclude commits that are reachable from the one(s)
762 given with a
<em>^</em> in front of them. The output is given in reverse
763 chronological order by default.
</p></div>
764 <div class=
"paragraph"><p>You can think of this as a set operation. Commits reachable from any of
765 the commits given on the command line form a set, and then commits reachable
766 from any of the ones given with
<em>^</em> in front are subtracted from that
767 set. The remaining commits are what comes out in the command
’s output.
768 Various other options and paths parameters can be used to further limit the
770 <div class=
"paragraph"><p>Thus, the following command:
</p></div>
771 <div class=
"listingblock">
772 <div class=
"content">
773 <pre><code>$ git rev-list foo bar ^baz
</code></pre>
775 <div class=
"paragraph"><p>means
"list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but
776 not from <em>baz</em>".
</p></div>
777 <div class=
"paragraph"><p>A special notation
"<em><commit1></em>..<em><commit2></em>" can be used as a
778 short-hand for
"^<em><commit1></em> <em><commit2></em>". For example, either of
779 the following may be used interchangeably:
</p></div>
780 <div class=
"listingblock">
781 <div class=
"content">
782 <pre><code>$ git rev-list origin..HEAD
783 $ git rev-list HEAD ^origin
</code></pre>
785 <div class=
"paragraph"><p>Another special notation is
"<em><commit1></em>…<em><commit2></em>" which is useful
786 for merges. The resulting set of commits is the symmetric difference
787 between the two operands. The following two commands are equivalent:
</p></div>
788 <div class=
"listingblock">
789 <div class=
"content">
790 <pre><code>$ git rev-list A B --not $(git merge-base --all A B)
791 $ git rev-list A...B
</code></pre>
793 <div class=
"paragraph"><p><em>rev-list
</em> is a very essential Git command, since it
794 provides the ability to build and traverse commit ancestry graphs. For
795 this reason, it has a lot of different options that enables it to be
796 used by commands as different as
<em>git bisect
</em> and
797 <em>git repack
</em>.
</p></div>
801 <h2 id=
"_options">OPTIONS
</h2>
802 <div class=
"sectionbody">
804 <h3 id=
"_commit_limiting">Commit Limiting
</h3>
805 <div class=
"paragraph"><p>Besides specifying a range of commits that should be listed using the
806 special notations explained in the description, additional commit
807 limiting may be applied.
</p></div>
808 <div class=
"paragraph"><p>Using more options generally further limits the output (e.g.
809 <code>--since=
<date1
></code> limits to commits newer than
<code><date1
></code>, and using it
810 with
<code>--grep=
<pattern
></code> further limits to commits whose log message
811 has a line that matches
<code><pattern
></code>), unless otherwise noted.
</p></div>
812 <div class=
"paragraph"><p>Note that these are applied before commit
813 ordering and formatting options, such as
<code>--reverse
</code>.
</p></div>
814 <div class=
"dlist"><dl>
822 --max-count=
<number
>
826 Limit the number of commits to output.
830 --skip=
<number
>
834 Skip
<em>number
</em> commits before starting to show the commit output.
845 Show commits more recent than a specific date.
849 --since-as-filter=
<date
>
853 Show all commits more recent than a specific date. This visits
854 all commits in the range, rather than stopping at the first commit which
855 is older than a specific date.
862 --before=
<date
>
866 Show commits older than a specific date.
870 --max-age=
<timestamp
>
873 --min-age=
<timestamp
>
877 Limit the commits output to specified time range.
881 --author=
<pattern
>
884 --committer=
<pattern
>
888 Limit the commits output to ones with author/committer
889 header lines that match the specified pattern (regular
890 expression). With more than one
<code>--author=
<pattern
></code>,
891 commits whose author matches any of the given patterns are
892 chosen (similarly for multiple
<code>--committer=
<pattern
></code>).
896 --grep-reflog=
<pattern
>
900 Limit the commits output to ones with reflog entries that
901 match the specified pattern (regular expression). With
902 more than one
<code>--grep-reflog
</code>, commits whose reflog message
903 matches any of the given patterns are chosen. It is an
904 error to use this option unless
<code>--walk-reflogs
</code> is in use.
908 --grep=
<pattern
>
912 Limit the commits output to ones with log message that
913 matches the specified pattern (regular expression). With
914 more than one
<code>--grep=
<pattern
></code>, commits whose message
915 matches any of the given patterns are chosen (but see
916 <code>--all-match
</code>).
924 Limit the commits output to ones that match all given
<code>--grep
</code>,
925 instead of ones that match at least one.
933 Limit the commits output to ones with log message that do not
934 match the pattern specified with
<code>--grep=
<pattern
></code>.
945 Match the regular expression limiting patterns without regard to letter
954 Consider the limiting patterns to be basic regular expressions;
966 Consider the limiting patterns to be extended regular expressions
967 instead of the default basic regular expressions.
978 Consider the limiting patterns to be fixed strings (don
’t interpret
979 pattern as a regular expression).
990 Consider the limiting patterns to be Perl-compatible regular
993 <div class=
"paragraph"><p>Support for these types of regular expressions is an optional
994 compile-time dependency. If Git wasn
’t compiled with support for them
995 providing this option will cause it to die.
</p></div>
1002 Stop when a given path disappears from the tree.
1005 <dt class=
"hdlist1">
1010 Print only merge commits. This is exactly the same as
<code>--min-parents=
2</code>.
1013 <dt class=
"hdlist1">
1018 Do not print commits with more than one parent. This is
1019 exactly the same as
<code>--max-parents=
1</code>.
1022 <dt class=
"hdlist1">
1023 --min-parents=
<number
>
1025 <dt class=
"hdlist1">
1026 --max-parents=
<number
>
1028 <dt class=
"hdlist1">
1031 <dt class=
"hdlist1">
1036 Show only commits which have at least (or at most) that many parent
1037 commits. In particular,
<code>--max-parents=
1</code> is the same as
<code>--no-merges
</code>,
1038 <code>--min-parents=
2</code> is the same as
<code>--merges
</code>.
<code>--max-parents=
0</code>
1039 gives all root commits and
<code>--min-parents=
3</code> all octopus merges.
1041 <div class=
"paragraph"><p><code>--no-min-parents
</code> and
<code>--no-max-parents
</code> reset these limits (to no limit)
1042 again. Equivalent forms are
<code>--min-parents=
0</code> (any commit has
0 or more
1043 parents) and
<code>--max-parents=-
1</code> (negative numbers denote no upper limit).
</p></div>
1045 <dt class=
"hdlist1">
1050 When finding commits to include, follow only the first
1051 parent commit upon seeing a merge commit. This option
1052 can give a better overview when viewing the evolution of
1053 a particular topic branch, because merges into a topic
1054 branch tend to be only about adjusting to updated upstream
1055 from time to time, and this option allows you to ignore
1056 the individual commits brought in to your history by such
1060 <dt class=
"hdlist1">
1061 --exclude-first-parent-only
1065 When finding commits to exclude (with a
<em>^</em>), follow only
1066 the first parent commit upon seeing a merge commit.
1067 This can be used to find the set of changes in a topic branch
1068 from the point where it diverged from the remote branch, given
1069 that arbitrary merges can be valid topic branch changes.
1072 <dt class=
"hdlist1">
1077 Reverses the meaning of the
<em>^</em> prefix (or lack thereof)
1078 for all following revision specifiers, up to the next
<code>--not
</code>.
1081 <dt class=
"hdlist1">
1086 Pretend as if all the refs in
<code>refs/
</code>, along with
<code>HEAD
</code>, are
1087 listed on the command line as
<em><commit
></em>.
1090 <dt class=
"hdlist1">
1091 --branches[=
<pattern
>]
1095 Pretend as if all the refs in
<code>refs/heads
</code> are listed
1096 on the command line as
<em><commit
></em>. If
<em><pattern
></em> is given, limit
1097 branches to ones matching given shell glob. If pattern lacks
<em>?
</em>,
1098 <em>*</em>, or
<em>[
</em>,
<em>/
*</em> at the end is implied.
1101 <dt class=
"hdlist1">
1102 --tags[=
<pattern
>]
1106 Pretend as if all the refs in
<code>refs/tags
</code> are listed
1107 on the command line as
<em><commit
></em>. If
<em><pattern
></em> is given, limit
1108 tags to ones matching given shell glob. If pattern lacks
<em>?
</em>,
<em>*</em>,
1109 or
<em>[
</em>,
<em>/
*</em> at the end is implied.
1112 <dt class=
"hdlist1">
1113 --remotes[=
<pattern
>]
1117 Pretend as if all the refs in
<code>refs/remotes
</code> are listed
1118 on the command line as
<em><commit
></em>. If
<em><pattern
></em> is given, limit
1119 remote-tracking branches to ones matching given shell glob.
1120 If pattern lacks
<em>?
</em>,
<em>*</em>, or
<em>[
</em>,
<em>/
*</em> at the end is implied.
1123 <dt class=
"hdlist1">
1124 --glob=
<glob-pattern
>
1128 Pretend as if all the refs matching shell glob
<em><glob-pattern
></em>
1129 are listed on the command line as
<em><commit
></em>. Leading
<em>refs/
</em>,
1130 is automatically prepended if missing. If pattern lacks
<em>?
</em>,
<em>*</em>,
1131 or
<em>[
</em>,
<em>/
*</em> at the end is implied.
1134 <dt class=
"hdlist1">
1135 --exclude=
<glob-pattern
>
1139 Do not include refs matching
<em><glob-pattern
></em> that the next
<code>--all
</code>,
1140 <code>--branches
</code>,
<code>--tags
</code>,
<code>--remotes
</code>, or
<code>--glob
</code> would otherwise
1141 consider. Repetitions of this option accumulate exclusion patterns
1142 up to the next
<code>--all
</code>,
<code>--branches
</code>,
<code>--tags
</code>,
<code>--remotes
</code>, or
1143 <code>--glob
</code> option (other options or arguments do not clear
1144 accumulated patterns).
1146 <div class=
"paragraph"><p>The patterns given should not begin with
<code>refs/heads
</code>,
<code>refs/tags
</code>, or
1147 <code>refs/remotes
</code> when applied to
<code>--branches
</code>,
<code>--tags
</code>, or
<code>--remotes
</code>,
1148 respectively, and they must begin with
<code>refs/
</code> when applied to
<code>--glob
</code>
1149 or
<code>--all
</code>. If a trailing
<em>/
*</em> is intended, it must be given
1150 explicitly.
</p></div>
1152 <dt class=
"hdlist1">
1153 --exclude-hidden=[fetch|receive|uploadpack]
1157 Do not include refs that would be hidden by
<code>git-fetch
</code>,
1158 <code>git-receive-pack
</code> or
<code>git-upload-pack
</code> by consulting the appropriate
1159 <code>fetch.hideRefs
</code>,
<code>receive.hideRefs
</code> or
<code>uploadpack.hideRefs
</code>
1160 configuration along with
<code>transfer.hideRefs
</code> (see
1161 <a href=
"git-config.html">git-config(
1)
</a>). This option affects the next pseudo-ref option
1162 <code>--all
</code> or
<code>--glob
</code> and is cleared after processing them.
1165 <dt class=
"hdlist1">
1170 Pretend as if all objects mentioned by reflogs are listed on the
1171 command line as
<code><commit
></code>.
1174 <dt class=
"hdlist1">
1179 Pretend as if all objects mentioned as ref tips of alternate
1180 repositories were listed on the command line. An alternate
1181 repository is any repository whose object directory is specified
1182 in
<code>objects/info/alternates
</code>. The set of included objects may
1183 be modified by
<code>core.alternateRefsCommand
</code>, etc. See
1184 <a href=
"git-config.html">git-config(
1)
</a>.
1187 <dt class=
"hdlist1">
1192 By default, all working trees will be examined by the
1193 following options when there are more than one (see
1194 <a href=
"git-worktree.html">git-worktree(
1)
</a>):
<code>--all
</code>,
<code>--reflog
</code> and
1195 <code>--indexed-objects
</code>.
1196 This option forces them to examine the current working tree
1200 <dt class=
"hdlist1">
1205 Upon seeing an invalid object name in the input, pretend as if
1206 the bad input was not given.
1209 <dt class=
"hdlist1">
1214 In addition to the
<em><commit
></em> listed on the command
1215 line, read them from the standard input. If a
<code>--
</code> separator is
1216 seen, stop reading commits and start reading paths to limit the
1220 <dt class=
"hdlist1">
1225 Don
’t print anything to standard output. This form
1226 is primarily meant to allow the caller to
1227 test the exit status to see if a range of objects is fully
1228 connected (or not). It is faster than redirecting stdout
1229 to
<code>/dev/null
</code> as the output does not have to be formatted.
1232 <dt class=
"hdlist1">
1235 <dt class=
"hdlist1">
1240 Suppress normal output; instead, print the sum of the bytes used
1241 for on-disk storage by the selected commits or objects. This is
1242 equivalent to piping the output into
<code>git cat-file
1243 --batch-check='%(objectsize:disk)'
</code>, except that it runs much
1244 faster (especially with
<code>--use-bitmap-index
</code>). See the
<code>CAVEATS
</code>
1245 section in
<a href=
"git-cat-file.html">git-cat-file(
1)
</a> for the limitations of what
1246 "on-disk storage" means.
1247 With the optional value
<code>human
</code>, on-disk storage size is shown
1248 in human-readable string(e.g.
12.24 Kib,
3.50 Mib).
1251 <dt class=
"hdlist1">
1256 Like
<code>--cherry-pick
</code> (see below) but mark equivalent commits
1257 with
<code>=
</code> rather than omitting them, and inequivalent ones with
<code>+
</code>.
1260 <dt class=
"hdlist1">
1265 Omit any commit that introduces the same change as
1266 another commit on the
“other side
” when the set of
1267 commits are limited with symmetric difference.
1269 <div class=
"paragraph"><p>For example, if you have two branches,
<code>A
</code> and
<code>B
</code>, a usual way
1270 to list all commits on only one side of them is with
1271 <code>--left-right
</code> (see the example below in the description of
1272 the
<code>--left-right
</code> option). However, it shows the commits that were
1273 cherry-picked from the other branch (for example,
“3rd on b
” may be
1274 cherry-picked from branch A). With this option, such pairs of commits are
1275 excluded from the output.
</p></div>
1277 <dt class=
"hdlist1">
1280 <dt class=
"hdlist1">
1285 List only commits on the respective side of a symmetric difference,
1286 i.e. only those which would be marked
<code><</code> resp.
<code>></code> by
1287 <code>--left-right
</code>.
1289 <div class=
"paragraph"><p>For example,
<code>--cherry-pick --right-only A...B
</code> omits those
1290 commits from
<code>B
</code> which are in
<code>A
</code> or are patch-equivalent to a commit in
1291 <code>A
</code>. In other words, this lists the
<code>+
</code> commits from
<code>git cherry A B
</code>.
1292 More precisely,
<code>--cherry-pick --right-only --no-merges
</code> gives the exact
1295 <dt class=
"hdlist1">
1300 A synonym for
<code>--right-only --cherry-mark --no-merges
</code>; useful to
1301 limit the output to the commits on our side and mark those that
1302 have been applied to the other side of a forked history with
1303 <code>git log --cherry upstream...mybranch
</code>, similar to
1304 <code>git cherry upstream mybranch
</code>.
1307 <dt class=
"hdlist1">
1310 <dt class=
"hdlist1">
1315 Instead of walking the commit ancestry chain, walk
1316 reflog entries from the most recent one to older ones.
1317 When this option is used you cannot specify commits to
1318 exclude (that is,
<em>^commit
</em>,
<em>commit1..commit2
</em>,
1319 and
<em>commit1...commit2
</em> notations cannot be used).
1321 <div class=
"paragraph"><p>With
<code>--pretty
</code> format other than
<code>oneline
</code> and
<code>reference
</code> (for obvious reasons),
1322 this causes the output to have two extra lines of information
1323 taken from the reflog. The reflog designator in the output may be shown
1324 as
<code>ref@{Nth}
</code> (where
<code>Nth
</code> is the reverse-chronological index in the
1325 reflog) or as
<code>ref@{timestamp}
</code> (with the timestamp for that entry),
1326 depending on a few rules:
</p></div>
1327 <div class=
"openblock">
1328 <div class=
"content">
1329 <div class=
"olist arabic"><ol class=
"arabic">
1332 If the starting point is specified as
<code>ref@{Nth}
</code>, show the index
1338 If the starting point was specified as
<code>ref@{now}
</code>, show the
1344 If neither was used, but
<code>--date
</code> was given on the command line, show
1345 the timestamp in the format requested by
<code>--date
</code>.
1350 Otherwise, show the index format.
1355 <div class=
"paragraph"><p>Under
<code>--pretty=oneline
</code>, the commit message is
1356 prefixed with this information on the same line.
1357 This option cannot be combined with
<code>--reverse
</code>.
1358 See also
<a href=
"git-reflog.html">git-reflog(
1)
</a>.
</p></div>
1359 <div class=
"paragraph"><p>Under
<code>--pretty=reference
</code>, this information will not be shown at all.
</p></div>
1361 <dt class=
"hdlist1">
1366 After a failed merge, show refs that touch files having a
1367 conflict and don
’t exist on all heads to merge.
1370 <dt class=
"hdlist1">
1375 Output excluded boundary commits. Boundary commits are
1376 prefixed with
<code>-
</code>.
1379 <dt class=
"hdlist1">
1384 Try to speed up the traversal using the pack bitmap index (if
1385 one is available). Note that when traversing with
<code>--objects
</code>,
1386 trees and blobs will not have their associated path printed.
1389 <dt class=
"hdlist1">
1390 --progress=
<header
>
1394 Show progress reports on stderr as objects are considered. The
1395 <code><header
></code> text will be printed with each progress update.
1401 <h3 id=
"_history_simplification">History Simplification
</h3>
1402 <div class=
"paragraph"><p>Sometimes you are only interested in parts of the history, for example the
1403 commits modifying a particular
<path
>. But there are two parts of
1404 <em>History Simplification
</em>, one part is selecting the commits and the other
1405 is how to do it, as there are various strategies to simplify the history.
</p></div>
1406 <div class=
"paragraph"><p>The following options select the commits to be shown:
</p></div>
1407 <div class=
"dlist"><dl>
1408 <dt class=
"hdlist1">
1413 Commits modifying the given
<paths
> are selected.
1416 <dt class=
"hdlist1">
1417 --simplify-by-decoration
1421 Commits that are referred by some branch or tag are selected.
1425 <div class=
"paragraph"><p>Note that extra commits can be shown to give a meaningful history.
</p></div>
1426 <div class=
"paragraph"><p>The following options affect the way the simplification is performed:
</p></div>
1427 <div class=
"dlist"><dl>
1428 <dt class=
"hdlist1">
1433 Simplifies the history to the simplest history explaining the
1434 final state of the tree. Simplest because it prunes some side
1435 branches if the end result is the same (i.e. merging branches
1436 with the same content)
1439 <dt class=
"hdlist1">
1444 Include all commits from the default mode, but also any merge
1445 commits that are not TREESAME to the first parent but are
1446 TREESAME to a later parent. This mode is helpful for showing
1447 the merge commits that
"first introduced" a change to a branch.
1450 <dt class=
"hdlist1">
1455 Same as the default mode, but does not prune some history.
1458 <dt class=
"hdlist1">
1463 Only the selected commits are shown, plus some to have a
1467 <dt class=
"hdlist1">
1472 All commits in the simplified history are shown.
1475 <dt class=
"hdlist1">
1480 Additional option to
<code>--full-history
</code> to remove some needless
1481 merges from the resulting history, as there are no selected
1482 commits contributing to this merge.
1485 <dt class=
"hdlist1">
1486 --ancestry-path[=
<commit
>]
1490 When given a range of commits to display (e.g.
<em>commit1..commit2
</em>
1491 or
<em>commit2
^commit1
</em>), only display commits in that range
1492 that are ancestors of
<commit
>, descendants of
<commit
>, or
1493 <commit
> itself. If no commit is specified, use
<em>commit1
</em> (the
1494 excluded part of the range) as
<commit
>. Can be passed multiple
1495 times; if so, a commit is included if it is any of the commits
1496 given or if it is an ancestor or descendant of one of them.
1500 <div class=
"paragraph"><p>A more detailed explanation follows.
</p></div>
1501 <div class=
"paragraph"><p>Suppose you specified
<code>foo
</code> as the
<paths
>. We shall call commits
1502 that modify
<code>foo
</code> !TREESAME, and the rest TREESAME. (In a diff
1503 filtered for
<code>foo
</code>, they look different and equal, respectively.)
</p></div>
1504 <div class=
"paragraph"><p>In the following, we will always refer to the same example history to
1505 illustrate the differences between simplification settings. We assume
1506 that you are filtering for a file
<code>foo
</code> in this commit graph:
</p></div>
1507 <div class=
"listingblock">
1508 <div class=
"content">
1509 <pre><code> .-A---M---N---O---P---Q
1513 `-------------' X
</code></pre>
1515 <div class=
"paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of
1516 each merge. The commits are:
</p></div>
1517 <div class=
"ulist"><ul>
1520 <code>I
</code> is the initial commit, in which
<code>foo
</code> exists with contents
1521 “asdf
”, and a file
<code>quux
</code> exists with contents
“quux
”. Initial
1522 commits are compared to an empty tree, so
<code>I
</code> is !TREESAME.
1527 In
<code>A
</code>,
<code>foo
</code> contains just
“foo
”.
1532 <code>B
</code> contains the same change as
<code>A
</code>. Its merge
<code>M
</code> is trivial and
1533 hence TREESAME to all parents.
1538 <code>C
</code> does not change
<code>foo
</code>, but its merge
<code>N
</code> changes it to
“foobar
”,
1539 so it is not TREESAME to any parent.
1544 <code>D
</code> sets
<code>foo
</code> to
“baz
”. Its merge
<code>O
</code> combines the strings from
1545 <code>N
</code> and
<code>D
</code> to
“foobarbaz
”; i.e., it is not TREESAME to any parent.
1550 <code>E
</code> changes
<code>quux
</code> to
“xyzzy
”, and its merge
<code>P
</code> combines the
1551 strings to
“quux xyzzy
”.
<code>P
</code> is TREESAME to
<code>O
</code>, but not to
<code>E
</code>.
1556 <code>X
</code> is an independent root commit that added a new file
<code>side
</code>, and
<code>Y
</code>
1557 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
1558 <code>Q
</code> is TREESAME to
<code>P
</code>, but not to
<code>Y
</code>.
1562 <div class=
"paragraph"><p><code>rev-list
</code> walks backwards through history, including or excluding
1563 commits based on whether
<code>--full-history
</code> and/or parent rewriting
1564 (via
<code>--parents
</code> or
<code>--children
</code>) are used. The following settings
1565 are available.
</p></div>
1566 <div class=
"dlist"><dl>
1567 <dt class=
"hdlist1">
1572 Commits are included if they are not TREESAME to any parent
1573 (though this can be changed, see
<code>--sparse
</code> below). If the
1574 commit was a merge, and it was TREESAME to one parent, follow
1575 only that parent. (Even if there are several TREESAME
1576 parents, follow only one of them.) Otherwise, follow all
1579 <div class=
"paragraph"><p>This results in:
</p></div>
1580 <div class=
"listingblock">
1581 <div class=
"content">
1582 <pre><code> .-A---N---O
1584 I---------D
</code></pre>
1586 <div class=
"paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1587 available, removed
<code>B
</code> from consideration entirely.
<code>C
</code> was
1588 considered via
<code>N
</code>, but is TREESAME. Root commits are compared to an
1589 empty tree, so
<code>I
</code> is !TREESAME.
</p></div>
1590 <div class=
"paragraph"><p>Parent/child relations are only visible with
<code>--parents
</code>, but that does
1591 not affect the commits selected in default mode, so we have shown the
1592 parent lines.
</p></div>
1594 <dt class=
"hdlist1">
1595 --full-history without parent rewriting
1599 This mode differs from the default in one point: always follow
1600 all parents of a merge, even if it is TREESAME to one of them.
1601 Even if more than one side of the merge has commits that are
1602 included, this does not imply that the merge itself is! In
1605 <div class=
"listingblock">
1606 <div class=
"content">
1607 <pre><code> I A B N D O P Q
</code></pre>
1609 <div class=
"paragraph"><p><code>M
</code> was excluded because it is TREESAME to both parents.
<code>E
</code>,
1610 <code>C
</code> and
<code>B
</code> were all walked, but only
<code>B
</code> was !TREESAME, so the others
1611 do not appear.
</p></div>
1612 <div class=
"paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1613 about the parent/child relationships between the commits, so we show
1614 them disconnected.
</p></div>
1616 <dt class=
"hdlist1">
1617 --full-history with parent rewriting
1621 Ordinary commits are only included if they are !TREESAME
1622 (though this can be changed, see
<code>--sparse
</code> below).
1624 <div class=
"paragraph"><p>Merges are always included. However, their parent list is rewritten:
1625 Along each parent, prune away commits that are not included
1626 themselves. This results in
</p></div>
1627 <div class=
"listingblock">
1628 <div class=
"content">
1629 <pre><code> .-A---M---N---O---P---Q
1633 `-------------'
</code></pre>
1635 <div class=
"paragraph"><p>Compare to
<code>--full-history
</code> without rewriting above. Note that
<code>E
</code>
1636 was pruned away because it is TREESAME, but the parent list of P was
1637 rewritten to contain
<code>E
</code>'s parent
<code>I
</code>. The same happened for
<code>C
</code> and
1638 <code>N
</code>, and
<code>X
</code>,
<code>Y
</code> and
<code>Q
</code>.
</p></div>
1641 <div class=
"paragraph"><p>In addition to the above settings, you can change whether TREESAME
1642 affects inclusion:
</p></div>
1643 <div class=
"dlist"><dl>
1644 <dt class=
"hdlist1">
1649 Commits that are walked are included if they are not TREESAME
1653 <dt class=
"hdlist1">
1658 All commits that are walked are included.
1660 <div class=
"paragraph"><p>Note that without
<code>--full-history
</code>, this still simplifies merges: if
1661 one of the parents is TREESAME, we follow only that one, so the other
1662 sides of the merge are never walked.
</p></div>
1664 <dt class=
"hdlist1">
1669 First, build a history graph in the same way that
1670 <code>--full-history
</code> with parent rewriting does (see above).
1672 <div class=
"paragraph"><p>Then simplify each commit
<code>C
</code> to its replacement
<code>C'
</code> in the final
1673 history according to the following rules:
</p></div>
1674 <div class=
"openblock">
1675 <div class=
"content">
1676 <div class=
"ulist"><ul>
1679 Set
<code>C'
</code> to
<code>C
</code>.
1684 Replace each parent
<code>P
</code> of
<code>C'
</code> with its simplification
<code>P'
</code>. In
1685 the process, drop parents that are ancestors of other parents or that are
1686 root commits TREESAME to an empty tree, and remove duplicates, but take care
1687 to never drop all parents that we are TREESAME to.
1692 If after this parent rewriting,
<code>C'
</code> is a root or merge commit (has
1693 zero or
>1 parents), a boundary commit, or !TREESAME, it remains.
1694 Otherwise, it is replaced with its only parent.
1699 <div class=
"paragraph"><p>The effect of this is best shown by way of comparing to
1700 <code>--full-history
</code> with parent rewriting. The example turns into:
</p></div>
1701 <div class=
"listingblock">
1702 <div class=
"content">
1703 <pre><code> .-A---M---N---O
1707 `---------'
</code></pre>
1709 <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>
1710 <div class=
"openblock">
1711 <div class=
"content">
1712 <div class=
"ulist"><ul>
1715 <code>N
</code>'s parent list had
<code>I
</code> removed, because it is an ancestor of the
1716 other parent
<code>M
</code>. Still,
<code>N
</code> remained because it is !TREESAME.
1721 <code>P
</code>'s parent list similarly had
<code>I
</code> removed.
<code>P
</code> was then
1722 removed completely, because it had one parent and is TREESAME.
1727 <code>Q
</code>'s parent list had
<code>Y
</code> simplified to
<code>X
</code>.
<code>X
</code> was then removed, because it
1728 was a TREESAME root.
<code>Q
</code> was then removed completely, because it had one
1729 parent and is TREESAME.
1736 <div class=
"paragraph"><p>There is another simplification mode available:
</p></div>
1737 <div class=
"dlist"><dl>
1738 <dt class=
"hdlist1">
1739 --ancestry-path[=
<commit
>]
1743 Limit the displayed commits to those which are an ancestor of
1744 <commit
>, or which are a descendant of
<commit
>, or are
<commit
>
1747 <div class=
"paragraph"><p>As an example use case, consider the following commit history:
</p></div>
1748 <div class=
"listingblock">
1749 <div class=
"content">
1750 <pre><code> D---E-------F
1752 B---C---G---H---I---J
1754 A-------K---------------L--M
</code></pre>
1756 <div class=
"paragraph"><p>A regular
<em>D..M
</em> computes the set of commits that are ancestors of
<code>M
</code>,
1757 but excludes the ones that are ancestors of
<code>D
</code>. This is useful to see
1758 what happened to the history leading to
<code>M
</code> since
<code>D
</code>, in the sense
1759 that
“what does
<code>M
</code> have that did not exist in
<code>D
</code>”. The result in this
1760 example would be all the commits, except
<code>A
</code> and
<code>B
</code> (and
<code>D
</code> itself,
1761 of course).
</p></div>
1762 <div class=
"paragraph"><p>When we want to find out what commits in
<code>M
</code> are contaminated with the
1763 bug introduced by
<code>D
</code> and need fixing, however, we might want to view
1764 only the subset of
<em>D..M
</em> that are actually descendants of
<code>D
</code>, i.e.
1765 excluding
<code>C
</code> and
<code>K
</code>. This is exactly what the
<code>--ancestry-path
</code>
1766 option does. Applied to the
<em>D..M
</em> range, it results in:
</p></div>
1767 <div class=
"listingblock">
1768 <div class=
"content">
1769 <pre><code> E-------F
1775 <div class=
"paragraph"><p>We can also use
<code>--ancestry-path=D
</code> instead of
<code>--ancestry-path
</code> which
1776 means the same thing when applied to the
<em>D..M
</em> range but is just more
1778 <div class=
"paragraph"><p>If we instead are interested in a given topic within this range, and all
1779 commits affected by that topic, we may only want to view the subset of
1780 <code>D..M
</code> which contain that topic in their ancestry path. So, using
1781 <code>--ancestry-path=H D..M
</code> for example would result in:
</p></div>
1782 <div class=
"listingblock">
1783 <div class=
"content">
1790 <div class=
"paragraph"><p>Whereas
<code>--ancestry-path=K D..M
</code> would result in
</p></div>
1791 <div class=
"listingblock">
1792 <div class=
"content">
1793 <pre><code> K---------------L--M
</code></pre>
1797 <div class=
"paragraph"><p>Before discussing another option,
<code>--show-pulls
</code>, we need to
1798 create a new example history.
</p></div>
1799 <div class=
"paragraph"><p>A common problem users face when looking at simplified history is that a
1800 commit they know changed a file somehow does not appear in the file
’s
1801 simplified history. Let
’s demonstrate a new example and show how options
1802 such as
<code>--full-history
</code> and
<code>--simplify-merges
</code> works in that case:
</p></div>
1803 <div class=
"listingblock">
1804 <div class=
"content">
1805 <pre><code> .-A---M-----C--N---O---P
1810 `---X--' `---Y--'
</code></pre>
1812 <div class=
"paragraph"><p>For this example, suppose
<code>I
</code> created
<code>file.txt
</code> which was modified by
1813 <code>A
</code>,
<code>B
</code>, and
<code>X
</code> in different ways. The single-parent commits
<code>C
</code>,
<code>Z
</code>,
1814 and
<code>Y
</code> do not change
<code>file.txt
</code>. The merge commit
<code>M
</code> was created by
1815 resolving the merge conflict to include both changes from
<code>A
</code> and
<code>B
</code>
1816 and hence is not TREESAME to either. The merge commit
<code>R
</code>, however, was
1817 created by ignoring the contents of
<code>file.txt
</code> at
<code>M
</code> and taking only
1818 the contents of
<code>file.txt
</code> at
<code>X
</code>. Hence,
<code>R
</code> is TREESAME to
<code>X
</code> but not
1819 <code>M
</code>. Finally, the natural merge resolution to create
<code>N
</code> is to take the
1820 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>.
1821 The merge commits
<code>O
</code> and
<code>P
</code> are TREESAME to their first parents, but
1822 not to their second parents,
<code>Z
</code> and
<code>Y
</code> respectively.
</p></div>
1823 <div class=
"paragraph"><p>When using the default mode,
<code>N
</code> and
<code>R
</code> both have a TREESAME parent, so
1824 those edges are walked and the others are ignored. The resulting history
1826 <div class=
"listingblock">
1827 <div class=
"content">
1828 <pre><code> I---X
</code></pre>
1830 <div class=
"paragraph"><p>When using
<code>--full-history
</code>, Git walks every edge. This will discover
1831 the commits
<code>A
</code> and
<code>B
</code> and the merge
<code>M
</code>, but also will reveal the
1832 merge commits
<code>O
</code> and
<code>P
</code>. With parent rewriting, the resulting graph is:
</p></div>
1833 <div class=
"listingblock">
1834 <div class=
"content">
1835 <pre><code> .-A---M--------N---O---P
1840 `---X--' `------'
</code></pre>
1842 <div class=
"paragraph"><p>Here, the merge commits
<code>O
</code> and
<code>P
</code> contribute extra noise, as they did
1843 not actually contribute a change to
<code>file.txt
</code>. They only merged a topic
1844 that was based on an older version of
<code>file.txt
</code>. This is a common
1845 issue in repositories using a workflow where many contributors work in
1846 parallel and merge their topic branches along a single trunk: many
1847 unrelated merges appear in the
<code>--full-history
</code> results.
</p></div>
1848 <div class=
"paragraph"><p>When using the
<code>--simplify-merges
</code> option, the commits
<code>O
</code> and
<code>P
</code>
1849 disappear from the results. This is because the rewritten second parents
1850 of
<code>O
</code> and
<code>P
</code> are reachable from their first parents. Those edges are
1851 removed and then the commits look like single-parent commits that are
1852 TREESAME to their parent. This also happens to the commit
<code>N
</code>, resulting
1853 in a history view as follows:
</p></div>
1854 <div class=
"listingblock">
1855 <div class=
"content">
1856 <pre><code> .-A---M--.
1861 `---X--'
</code></pre>
1863 <div class=
"paragraph"><p>In this view, we see all of the important single-parent changes from
1864 <code>A
</code>,
<code>B
</code>, and
<code>X
</code>. We also see the carefully-resolved merge
<code>M
</code> and the
1865 not-so-carefully-resolved merge
<code>R
</code>. This is usually enough information
1866 to determine why the commits
<code>A
</code> and
<code>B
</code> "disappeared" from history in
1867 the default view. However, there are a few issues with this approach.
</p></div>
1868 <div class=
"paragraph"><p>The first issue is performance. Unlike any previous option, the
1869 <code>--simplify-merges
</code> option requires walking the entire commit history
1870 before returning a single result. This can make the option difficult to
1871 use for very large repositories.
</p></div>
1872 <div class=
"paragraph"><p>The second issue is one of auditing. When many contributors are working
1873 on the same repository, it is important which merge commits introduced
1874 a change into an important branch. The problematic merge
<code>R
</code> above is
1875 not likely to be the merge commit that was used to merge into an
1876 important branch. Instead, the merge
<code>N
</code> was used to merge
<code>R
</code> and
<code>X
</code>
1877 into the important branch. This commit may have information about why
1878 the change
<code>X
</code> came to override the changes from
<code>A
</code> and
<code>B
</code> in its
1879 commit message.
</p></div>
1880 <div class=
"dlist"><dl>
1881 <dt class=
"hdlist1">
1886 In addition to the commits shown in the default history, show
1887 each merge commit that is not TREESAME to its first parent but
1888 is TREESAME to a later parent.
1890 <div class=
"paragraph"><p>When a merge commit is included by
<code>--show-pulls
</code>, the merge is
1891 treated as if it
"pulled" the change from another branch. When using
1892 <code>--show-pulls
</code> on this example (and no other options) the resulting
1894 <div class=
"listingblock">
1895 <div class=
"content">
1896 <pre><code> I---X---R---N
</code></pre>
1898 <div class=
"paragraph"><p>Here, the merge commits
<code>R
</code> and
<code>N
</code> are included because they pulled
1899 the commits
<code>X
</code> and
<code>R
</code> into the base branch, respectively. These
1900 merges are the reason the commits
<code>A
</code> and
<code>B
</code> do not appear in the
1901 default history.
</p></div>
1902 <div class=
"paragraph"><p>When
<code>--show-pulls
</code> is paired with
<code>--simplify-merges
</code>, the
1903 graph includes all of the necessary information:
</p></div>
1904 <div class=
"listingblock">
1905 <div class=
"content">
1906 <pre><code> .-A---M--. N
1911 `---X--'
</code></pre>
1913 <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>
1914 was simplified away. However,
<code>N
</code> still appears in the history as an
1915 important commit because it
"pulled" the change
<code>R
</code> into the main
1919 <div class=
"paragraph"><p>The
<code>--simplify-by-decoration
</code> option allows you to view only the
1920 big picture of the topology of the history, by omitting commits
1921 that are not referenced by tags. Commits are marked as !TREESAME
1922 (in other words, kept after history simplification rules described
1923 above) if (
1) they are referenced by tags, or (
2) they change the
1924 contents of the paths given on the command line. All other
1925 commits are marked as TREESAME (subject to be simplified away).
</p></div>
1928 <h3 id=
"_bisection_helpers">Bisection Helpers
</h3>
1929 <div class=
"dlist"><dl>
1930 <dt class=
"hdlist1">
1935 Limit output to the one commit object which is roughly halfway between
1936 included and excluded commits. Note that the bad bisection ref
1937 <code>refs/bisect/bad
</code> is added to the included commits (if it
1938 exists) and the good bisection refs
<code>refs/bisect/good-*
</code> are
1939 added to the excluded commits (if they exist). Thus, supposing there
1940 are no refs in
<code>refs/bisect/
</code>, if
1942 <div class=
"listingblock">
1943 <div class=
"content">
1944 <pre><code> $ git rev-list --bisect foo ^bar ^baz
</code></pre>
1946 <div class=
"paragraph"><p>outputs
<em>midpoint
</em>, the output of the two commands
</p></div>
1947 <div class=
"listingblock">
1948 <div class=
"content">
1949 <pre><code> $ git rev-list foo ^midpoint
1950 $ git rev-list midpoint ^bar ^baz
</code></pre>
1952 <div class=
"paragraph"><p>would be of roughly the same length. Finding the change which
1953 introduces a regression is thus reduced to a binary search: repeatedly
1954 generate and test new 'midpoint
’s until the commit chain is of length
1957 <dt class=
"hdlist1">
1962 This calculates the same as
<code>--bisect
</code>, except that refs in
1963 <code>refs/bisect/
</code> are not used, and except that this outputs
1964 text ready to be eval
’ed by the shell. These lines will assign the
1965 name of the midpoint revision to the variable
<code>bisect_rev
</code>, and the
1966 expected number of commits to be tested after
<code>bisect_rev
</code> is tested
1967 to
<code>bisect_nr
</code>, the expected number of commits to be tested if
1968 <code>bisect_rev
</code> turns out to be good to
<code>bisect_good
</code>, the expected
1969 number of commits to be tested if
<code>bisect_rev
</code> turns out to be bad to
1970 <code>bisect_bad
</code>, and the number of commits we are bisecting right now to
1971 <code>bisect_all
</code>.
1974 <dt class=
"hdlist1">
1979 This outputs all the commit objects between the included and excluded
1980 commits, ordered by their distance to the included and excluded
1981 commits. Refs in
<code>refs/bisect/
</code> are not used. The farthest
1982 from them is displayed first. (This is the only one displayed by
1983 <code>--bisect
</code>.)
1985 <div class=
"paragraph"><p>This is useful because it makes it easy to choose a good commit to
1986 test when you want to avoid to test some of them for some reason (they
1987 may not compile for example).
</p></div>
1988 <div class=
"paragraph"><p>This option can be used along with
<code>--bisect-vars
</code>, in this case,
1989 after all the sorted commit objects, there will be the same text as if
1990 <code>--bisect-vars
</code> had been used alone.
</p></div>
1995 <h3 id=
"_commit_ordering">Commit Ordering
</h3>
1996 <div class=
"paragraph"><p>By default, the commits are shown in reverse chronological order.
</p></div>
1997 <div class=
"dlist"><dl>
1998 <dt class=
"hdlist1">
2003 Show no parents before all of its children are shown, but
2004 otherwise show commits in the commit timestamp order.
2007 <dt class=
"hdlist1">
2012 Show no parents before all of its children are shown, but
2013 otherwise show commits in the author timestamp order.
2016 <dt class=
"hdlist1">
2021 Show no parents before all of its children are shown, and
2022 avoid showing commits on multiple lines of history
2025 <div class=
"paragraph"><p>For example, in a commit history like this:
</p></div>
2026 <div class=
"listingblock">
2027 <div class=
"content">
2028 <pre><code> ---
1----
2----
4----
7
2030 3----
5----
6----
8---
</code></pre>
2032 <div class=
"paragraph"><p>where the numbers denote the order of commit timestamps,
<code>git
2033 rev-list
</code> and friends with
<code>--date-order
</code> show the commits in the
2034 timestamp order:
8 7 6 5 4 3 2 1.
</p></div>
2035 <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
2036 3 1); some older commits are shown before newer ones in order to
2037 avoid showing the commits from two parallel development track mixed
2040 <dt class=
"hdlist1">
2045 Output the commits chosen to be shown (see Commit Limiting
2046 section above) in reverse order. Cannot be combined with
2047 <code>--walk-reflogs
</code>.
2053 <h3 id=
"_object_traversal">Object Traversal
</h3>
2054 <div class=
"paragraph"><p>These options are mostly targeted for packing of Git repositories.
</p></div>
2055 <div class=
"dlist"><dl>
2056 <dt class=
"hdlist1">
2061 Print the object IDs of any object referenced by the listed
2062 commits.
<code>--objects foo ^bar
</code> thus means
“send me
2063 all object IDs which I need to download if I have the commit
2064 object
<em>bar
</em> but not
<em>foo
</em>”. See also
<code>--object-names
</code> below.
2067 <dt class=
"hdlist1">
2072 Print tree and blob ids in order of the commits. The tree
2073 and blob ids are printed after they are first referenced
2077 <dt class=
"hdlist1">
2082 Similar to
<code>--objects
</code>, but also print the IDs of excluded
2083 commits prefixed with a
“-
” character. This is used by
2084 <a href=
"git-pack-objects.html">git-pack-objects(
1)
</a> to build a
“thin
” pack, which records
2085 objects in deltified form based on objects contained in these
2086 excluded commits to reduce network traffic.
2089 <dt class=
"hdlist1">
2090 --objects-edge-aggressive
2094 Similar to
<code>--objects-edge
</code>, but it tries harder to find excluded
2095 commits at the cost of increased time. This is used instead of
2096 <code>--objects-edge
</code> to build
“thin
” packs for shallow repositories.
2099 <dt class=
"hdlist1">
2104 Pretend as if all trees and blobs used by the index are listed
2105 on the command line. Note that you probably want to use
2106 <code>--objects
</code>, too.
2109 <dt class=
"hdlist1">
2114 Only useful with
<code>--objects
</code>; print the object IDs that are not
2118 <dt class=
"hdlist1">
2123 Only useful with
<code>--objects
</code>; print the names of the object IDs
2124 that are found. This is the default behavior. Note that the
2125 "name" of each object is ambiguous, and mostly intended as a
2126 hint for packing objects. In particular: no distinction is made between
2127 the names of tags, trees, and blobs; path names may be modified
2128 to remove newlines; and if an object would appear multiple times
2129 with different names, only one name is shown.
2132 <dt class=
"hdlist1">
2137 Only useful with
<code>--objects
</code>; does not print the names of the object
2138 IDs that are found. This inverts
<code>--object-names
</code>. This flag allows
2139 the output to be more easily parsed by commands such as
2140 <a href=
"git-cat-file.html">git-cat-file(
1)
</a>.
2143 <dt class=
"hdlist1">
2144 --filter=
<filter-spec
>
2148 Only useful with one of the
<code>--objects*
</code>; omits objects (usually
2149 blobs) from the list of printed objects. The
<em><filter-spec
></em>
2150 may be one of the following:
2152 <div class=
"paragraph"><p>The form
<em>--filter=blob:none
</em> omits all blobs.
</p></div>
2153 <div class=
"paragraph"><p>The form
<em>--filter=blob:limit=
<n
>[kmg]
</em> omits blobs larger than n bytes
2154 or units. n may be zero. The suffixes k, m, and g can be used to name
2155 units in KiB, MiB, or GiB. For example,
<em>blob:limit=
1k
</em> is the same
2156 as
<em>blob:limit=
1024</em>.
</p></div>
2157 <div class=
"paragraph"><p>The form
<em>--filter=object:type=(tag|commit|tree|blob)
</em> omits all objects
2158 which are not of the requested type.
</p></div>
2159 <div class=
"paragraph"><p>The form
<em>--filter=sparse:oid=
<blob-ish
></em> uses a sparse-checkout
2160 specification contained in the blob (or blob-expression)
<em><blob-ish
></em>
2161 to omit blobs that would not be required for a sparse checkout on
2162 the requested refs.
</p></div>
2163 <div class=
"paragraph"><p>The form
<em>--filter=tree:
<depth
></em> omits all blobs and trees whose depth
2164 from the root tree is
>=
<depth
> (minimum depth if an object is located
2165 at multiple depths in the commits traversed).
<depth
>=
0 will not include
2166 any trees or blobs unless included explicitly in the command-line (or
2167 standard input when --stdin is used).
<depth
>=
1 will include only the
2168 tree and blobs which are referenced directly by a commit reachable from
2169 <commit
> or an explicitly-given object.
<depth
>=
2 is like
<depth
>=
1
2170 while also including trees and blobs one more level removed from an
2171 explicitly-given commit or tree.
</p></div>
2172 <div class=
"paragraph"><p>Note that the form
<em>--filter=sparse:path=
<path
></em> that wants to read
2173 from an arbitrary path on the filesystem has been dropped for security
2175 <div class=
"paragraph"><p>Multiple
<em>--filter=
</em> flags can be specified to combine filters. Only
2176 objects which are accepted by every filter are included.
</p></div>
2177 <div class=
"paragraph"><p>The form
<em>--filter=combine:
<filter1
>+
<filter2
>+
…<filterN
></em> can also be
2178 used to combined several filters, but this is harder than just repeating
2179 the
<em>--filter
</em> flag and is usually not necessary. Filters are joined by
2180 <em>+</em> and individual filters are %-encoded (i.e. URL-encoded).
2181 Besides the
<em>+</em> and
<em>%
</em> characters, the following characters are
2182 reserved and also must be encoded:
<code>~!@#$^
&*()[]{}\;
",<>?</code><code>'`</code>
2183 as well as all characters with ASCII code <= <code>0x20</code>, which includes
2184 space and newline.</p></div>
2185 <div class="paragraph
"><p>Other arbitrary characters can also be encoded. For instance,
2186 <em>combine:tree:3+blob:none</em> and <em>combine:tree%3A3+blob%3Anone</em> are
2187 equivalent.</p></div>
2189 <dt class="hdlist1
">
2194 Turn off any previous <code>--filter=</code> argument.
2197 <dt class="hdlist1
">
2198 --filter-provided-objects
2202 Filter the list of explicitly provided objects, which would otherwise
2203 always be printed even if they did not match any of the filters. Only
2204 useful with <code>--filter=</code>.
2207 <dt class="hdlist1
">
2208 --filter-print-omitted
2212 Only useful with <code>--filter=</code>; prints a list of the objects omitted
2213 by the filter. Object IDs are prefixed with a “~” character.
2216 <dt class="hdlist1
">
2217 --missing=<missing-action>
2221 A debug option to help with future "partial clone
" development.
2222 This option specifies how missing objects are handled.
2224 <div class="paragraph
"><p>The form <em>--missing=error</em> requests that rev-list stop with an error if
2225 a missing object is encountered. This is the default action.</p></div>
2226 <div class="paragraph
"><p>The form <em>--missing=allow-any</em> will allow object traversal to continue
2227 if a missing object is encountered. Missing objects will silently be
2228 omitted from the results.</p></div>
2229 <div class="paragraph
"><p>The form <em>--missing=allow-promisor</em> is like <em>allow-any</em>, but will only
2230 allow object traversal to continue for EXPECTED promisor missing objects.
2231 Unexpected missing objects will raise an error.</p></div>
2232 <div class="paragraph
"><p>The form <em>--missing=print</em> is like <em>allow-any</em>, but will also print a
2233 list of the missing objects. Object IDs are prefixed with a “?” character.</p></div>
2235 <dt class="hdlist1
">
2236 --exclude-promisor-objects
2240 (For internal use only.) Prefilter object traversal at
2241 promisor boundary. This is used with partial clone. This is
2242 stronger than <code>--missing=allow-promisor</code> because it limits the
2243 traversal, rather than just silencing errors about missing
2247 <dt class="hdlist1
">
2248 --no-walk[=(sorted|unsorted)]
2252 Only show the given commits, but do not traverse their ancestors.
2253 This has no effect if a range is specified. If the argument
2254 <code>unsorted</code> is given, the commits are shown in the order they were
2255 given on the command line. Otherwise (if <code>sorted</code> or no argument
2256 was given), the commits are shown in reverse chronological order
2258 Cannot be combined with <code>--graph</code>.
2261 <dt class="hdlist1
">
2266 Overrides a previous <code>--no-walk</code>.
2272 <h3 id="_commit_formatting
">Commit Formatting</h3>
2273 <div class="paragraph
"><p>Using these options, <a href="git-rev-list.html
">git-rev-list(1)</a> will act similar to the
2274 more specialized family of commit log tools: <a href="git-log.html
">git-log(1)</a>,
2275 <a href="git-show.html
">git-show(1)</a>, and <a href="git-whatchanged.html
">git-whatchanged(1)</a></p></div>
2276 <div class="dlist
"><dl>
2277 <dt class="hdlist1
">
2278 --pretty[=<format>]
2280 <dt class="hdlist1
">
2281 --format=<format>
2285 Pretty-print the contents of the commit logs in a given format,
2286 where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
2287 <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:<string></em>
2288 and <em>tformat:<string></em>. When <em><format></em> is none of the above,
2289 and has <em>%placeholder</em> in it, it acts as if
2290 <em>--pretty=tformat:<format></em> were given.
2292 <div class="paragraph
"><p>See the "PRETTY FORMATS
" section for some additional details for each
2293 format. When <em>=<format></em> part is omitted, it defaults to <em>medium</em>.</p></div>
2294 <div class="paragraph
"><p>Note: you can specify the default pretty format in the repository
2295 configuration (see <a href="git-config.html
">git-config(1)</a>).</p></div>
2297 <dt class="hdlist1
">
2302 Instead of showing the full 40-byte hexadecimal commit object
2303 name, show a prefix that names the object uniquely.
2304 "--abbrev=
<n
>" (which also modifies diff output, if it is displayed)
2305 option can be used to specify the minimum length of the prefix.
2307 <div class="paragraph
"><p>This should make "--pretty=oneline
" a whole lot more readable for
2308 people using 80-column terminals.</p></div>
2310 <dt class="hdlist1
">
2315 Show the full 40-byte hexadecimal commit object name. This negates
2316 <code>--abbrev-commit</code>, either explicit or implied by other options such
2317 as "--oneline
". It also overrides the <code>log.abbrevCommit</code> variable.
2320 <dt class="hdlist1
">
2325 This is a shorthand for "--pretty=oneline --abbrev-commit
"
2329 <dt class="hdlist1
">
2330 --encoding=<encoding>
2334 Commit objects record the character encoding used for the log message
2335 in their encoding header; this option can be used to tell the
2336 command to re-code the commit log message in the encoding
2337 preferred by the user. For non plumbing commands this
2338 defaults to UTF-8. Note that if an object claims to be encoded
2339 in <code>X</code> and we are outputting in <code>X</code>, we will output the object
2340 verbatim; this means that invalid sequences in the original
2341 commit may be copied to the output. Likewise, if iconv(3) fails
2342 to convert the commit, we will quietly output the original
2346 <dt class="hdlist1
">
2347 --expand-tabs=<n>
2349 <dt class="hdlist1
">
2352 <dt class="hdlist1
">
2357 Perform a tab expansion (replace each tab with enough spaces
2358 to fill to the next display column that is multiple of <em><n></em>)
2359 in the log message before showing it in the output.
2360 <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
2361 <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
2362 which disables tab expansion.
2364 <div class="paragraph
"><p>By default, tabs are expanded in pretty formats that indent the log
2365 message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
2366 and <em>fuller</em>).</p></div>
2368 <dt class="hdlist1
">
2373 Check the validity of a signed commit object by passing the signature
2374 to <code>gpg --verify</code> and show the output.
2377 <dt class="hdlist1
">
2382 Synonym for <code>--date=relative</code>.
2385 <dt class="hdlist1
">
2386 --date=<format>
2390 Only takes effect for dates shown in human-readable format, such
2391 as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default
2392 value for the log command’s <code>--date</code> option. By default, dates
2393 are shown in the original time zone (either committer’s or
2394 author’s). If <code>-local</code> is appended to the format (e.g.,
2395 <code>iso-local</code>), the user’s local time zone is used instead.
2397 <div class="openblock
">
2398 <div class="content
">
2399 <div class="paragraph
"><p><code>--date=relative</code> shows dates relative to the current time,
2400 e.g. “2 hours ago”. The <code>-local</code> option has no effect for
2401 <code>--date=relative</code>.</p></div>
2402 <div class="paragraph
"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div>
2403 <div class="paragraph
"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format.
2404 The differences to the strict ISO 8601 format are:</p></div>
2405 <div class="ulist
"><ul>
2408 a space instead of the <code>T</code> date/time delimiter
2413 a space between time and time zone
2418 no colon between hours and minutes of the time zone
2422 <div class="paragraph
"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict
2423 ISO 8601 format.</p></div>
2424 <div class="paragraph
"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822
2425 format, often found in email messages.</p></div>
2426 <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>
2427 <div class="paragraph
"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01
2428 00:00:00 UTC), followed by a space, and then the timezone as an offset
2429 from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and
2430 the second two are minutes). I.e., as if the timestamp were formatted
2431 with <code>strftime("%s %z
")</code>).
2432 Note that the <code>-local</code> option does not affect the seconds-since-epoch
2433 value (which is always measured in UTC), but does switch the accompanying
2434 timezone value.</p></div>
2435 <div class="paragraph
"><p><code>--date=human</code> shows the timezone if the timezone does not match the
2436 current time-zone, and doesn’t print the whole date if that matches
2437 (ie skip printing year for dates that are "this year
", but also skip
2438 the whole date itself if it’s in the last few days and we can just say
2439 what weekday it was). For older dates the hour and minute is also
2441 <div class="paragraph
"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since
2442 1970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code>
2443 has no effect.</p></div>
2444 <div class="paragraph
"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>,
2445 except for %s, %z, and %Z, which are handled internally.
2446 Use <code>--date=format:%c</code> to show the date in your system locale’s
2447 preferred format. See the <code>strftime</code> manual for a complete list of
2448 format placeholders. When using <code>-local</code>, the correct syntax is
2449 <code>--date=format-local:...</code>.</p></div>
2450 <div class="paragraph
"><p><code>--date=default</code> is the default format, and is based on ctime(3)
2451 output. It shows a single line with three-letter day of the week,
2452 three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS
"
2453 format, followed by 4-digit year, plus timezone information, unless
2454 the local time zone is used, e.g. <code>Thu Jan 1 00:00:00 1970 +0000</code>.</p></div>
2457 <dt class="hdlist1
">
2462 Print the contents of the commit in raw-format; each record is
2463 separated with a NUL character.
2466 <dt class="hdlist1
">
2471 Suppress the header line containing "commit
" and the object ID printed before
2472 the specified format. This has no effect on the built-in formats; only custom
2473 formats are affected.
2476 <dt class="hdlist1
">
2481 Overrides a previous <code>--no-commit-header</code>.
2484 <dt class="hdlist1
">
2489 Print also the parents of the commit (in the form "commit parent
…").
2490 Also enables parent rewriting, see <em>History Simplification</em> above.
2493 <dt class="hdlist1
">
2498 Print also the children of the commit (in the form "commit child
…").
2499 Also enables parent rewriting, see <em>History Simplification</em> above.
2502 <dt class="hdlist1
">
2507 Print the raw commit timestamp.
2510 <dt class="hdlist1
">
2515 Mark which side of a symmetric difference a commit is reachable from.
2516 Commits from the left side are prefixed with <code><</code> and those from
2517 the right with <code>></code>. If combined with <code>--boundary</code>, those
2518 commits are prefixed with <code>-</code>.
2520 <div class="paragraph
"><p>For example, if you have this topology:</p></div>
2521 <div class="listingblock
">
2522 <div class="content
">
2523 <pre><code> y---b---b branch B
2527 o---x---a---a branch A</code></pre>
2529 <div class="paragraph
"><p>you would get an output like this:</p></div>
2530 <div class="listingblock
">
2531 <div class="content
">
2532 <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B
2534 >bbbbbbb... 3rd on b
2535 >bbbbbbb... 2nd on b
2536 <aaaaaaa... 3rd on a
2537 <aaaaaaa... 2nd on a
2538 -yyyyyyy... 1st on b
2539 -xxxxxxx... 1st on a</code></pre>
2542 <dt class="hdlist1
">
2547 Draw a text-based graphical representation of the commit history
2548 on the left hand side of the output. This may cause extra lines
2549 to be printed in between commits, in order for the graph history
2550 to be drawn properly.
2551 Cannot be combined with <code>--no-walk</code>.
2553 <div class="paragraph
"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div>
2554 <div class="paragraph
"><p>This implies the <code>--topo-order</code> option by default, but the
2555 <code>--date-order</code> option may also be specified.</p></div>
2557 <dt class="hdlist1
">
2558 --show-linear-break[=<barrier>]
2562 When --graph is not used, all history branches are flattened
2563 which can make it hard to see that the two consecutive commits
2564 do not belong to a linear branch. This option puts a barrier
2565 in between them in that case. If <code><barrier></code> is specified, it
2566 is the string that will be shown instead of the default one.
2569 <dt class="hdlist1
">
2574 Print a number stating how many commits would have been
2575 listed, and suppress all other output. When used together
2576 with <code>--left-right</code>, instead print the counts for left and
2577 right commits, separated by a tab. When used together with
2578 <code>--cherry-mark</code>, omit patch equivalent commits from these
2579 counts and print the count for equivalent commits separated
2588 <h2 id="_pretty_formats
">PRETTY FORMATS</h2>
2589 <div class="sectionbody
">
2590 <div class="paragraph
"><p>If the commit is a merge, and if the pretty-format
2591 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
2592 inserted before the <em>Author:</em> line. This line begins with
2593 "Merge:
" and the hashes of ancestral commits are printed,
2594 separated by spaces. Note that the listed commits may not
2595 necessarily be the list of the <strong>direct</strong> parent commits if you
2596 have limited your view of history: for example, if you are
2597 only interested in changes related to a certain directory or
2599 <div class="paragraph
"><p>There are several built-in formats, and you can define
2600 additional formats by setting a pretty.<name>
2601 config option to either another format name, or a
2602 <em>format:</em> string, as described below (see
2603 <a href="git-config.html
">git-config(1)</a>). Here are the details of the
2604 built-in formats:</p></div>
2605 <div class="ulist
"><ul>
2610 <div class="literalblock
">
2611 <div class="content
">
2612 <pre><code><hash> <title-line></code></pre>
2614 <div class="paragraph
"><p>This is designed to be as compact as possible.</p></div>
2620 <div class="literalblock
">
2621 <div class="content
">
2622 <pre><code>commit <hash>
2623 Author: <author></code></pre>
2625 <div class="literalblock
">
2626 <div class="content
">
2627 <pre><code><title-line></code></pre>
2634 <div class="literalblock
">
2635 <div class="content
">
2636 <pre><code>commit <hash>
2637 Author: <author>
2638 Date: <author-date></code></pre>
2640 <div class="literalblock
">
2641 <div class="content
">
2642 <pre><code><title-line></code></pre>
2644 <div class="literalblock
">
2645 <div class="content
">
2646 <pre><code><full-commit-message></code></pre>
2653 <div class="literalblock
">
2654 <div class="content
">
2655 <pre><code>commit <hash>
2656 Author: <author>
2657 Commit: <committer></code></pre>
2659 <div class="literalblock
">
2660 <div class="content
">
2661 <pre><code><title-line></code></pre>
2663 <div class="literalblock
">
2664 <div class="content
">
2665 <pre><code><full-commit-message></code></pre>
2672 <div class="literalblock
">
2673 <div class="content
">
2674 <pre><code>commit <hash>
2675 Author: <author>
2676 AuthorDate: <author-date>
2677 Commit: <committer>
2678 CommitDate: <committer-date></code></pre>
2680 <div class="literalblock
">
2681 <div class="content
">
2682 <pre><code><title-line></code></pre>
2684 <div class="literalblock
">
2685 <div class="content
">
2686 <pre><code><full-commit-message></code></pre>
2693 <div class="literalblock
">
2694 <div class="content
">
2695 <pre><code><abbrev-hash> (<title-line>, <short-author-date>)</code></pre>
2697 <div class="paragraph
"><p>This format is used to refer to another commit in a commit message and
2698 is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
2699 the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
2700 is explicitly specified. As with any <code>format:</code> with format
2701 placeholders, its output is not affected by other options like
2702 <code>--decorate</code> and <code>--walk-reflogs</code>.</p></div>
2708 <div class="literalblock
">
2709 <div class="content
">
2710 <pre><code>From <hash> <date>
2711 From: <author>
2712 Date: <author-date>
2713 Subject: [PATCH] <title-line></code></pre>
2715 <div class="literalblock
">
2716 <div class="content
">
2717 <pre><code><full-commit-message></code></pre>
2724 <div class="paragraph
"><p>Like <em>email</em>, but lines in the commit message starting with "From
"
2725 (preceded by zero or more ">") are quoted with ">" so they aren’t
2726 confused as starting a new commit.</p></div>
2732 <div class="paragraph
"><p>The <em>raw</em> format shows the entire commit exactly as
2733 stored in the commit object. Notably, the hashes are
2734 displayed in full, regardless of whether --abbrev or
2735 --no-abbrev are used, and <em>parents</em> information show the
2736 true parent commits, without taking grafts or history
2737 simplification into account. Note that this format affects the way
2738 commits are displayed, but not the way the diff is shown e.g. with
2739 <code>git log --raw</code>. To get full object names in a raw diff format,
2740 use <code>--no-abbrev</code>.</p></div>
2744 <em>format:<format-string></em>
2746 <div class="paragraph
"><p>The <em>format:<format-string></em> format allows you to specify which information
2747 you want to show. It works a little bit like printf format,
2748 with the notable exception that you get a newline with <em>%n</em>
2749 instead of <em>\n</em>.</p></div>
2750 <div class="paragraph
"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was
>>%s
<<%n
"</em>
2751 would show something like this:</p></div>
2752 <div class="listingblock
">
2753 <div class="content
">
2754 <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago
2755 The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</code></pre>
2757 <div class="paragraph
"><p>The placeholders are:</p></div>
2758 <div class="ulist
"><ul>
2761 Placeholders that expand to a single literal character:
2763 <div class="dlist
"><dl>
2764 <dt class="hdlist1
">
2772 <dt class="hdlist1
">
2780 <dt class="hdlist1
">
2785 print a byte from a hex code
2792 Placeholders that affect formatting of later placeholders:
2794 <div class="dlist
"><dl>
2795 <dt class="hdlist1
">
2803 <dt class="hdlist1
">
2808 switch color to green
2811 <dt class="hdlist1
">
2816 switch color to blue
2819 <dt class="hdlist1
">
2827 <dt class="hdlist1
">
2828 <em>%C(…)</em>
2832 color specification, as described under Values in the
2833 "CONFIGURATION FILE
" section of <a href="git-config.html
">git-config(1)</a>. By
2834 default, colors are shown only when enabled for log output
2835 (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
2836 the <code>auto</code> settings of the former if we are going to a
2837 terminal). <code>%C(auto,...)</code> is accepted as a historical
2838 synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
2839 <code>%C(always,...)</code> will show the colors even when color is
2840 not otherwise enabled (though consider just using
2841 <code>--color=always</code> to enable color for the whole output,
2842 including this format and anything else git might color).
2843 <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
2844 on the next placeholders until the color is switched
2848 <dt class="hdlist1
">
2853 left (<code><</code>), right (<code>></code>) or boundary (<code>-</code>) mark
2856 <dt class="hdlist1
">
2857 <em>%w([<w>[,<i1>[,<i2>]]])</em>
2861 switch line wrapping, like the -w option of
2862 <a href="git-shortlog.html
">git-shortlog(1)</a>.
2865 <dt class="hdlist1
">
2866 <em>%<( <N> [,trunc|ltrunc|mtrunc])</em>
2870 make the next placeholder take at
2871 least N column widths, padding spaces on
2872 the right if necessary. Optionally
2873 truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..ft</code>,
2874 the middle (mtrunc) <code>mi..le</code>, or the end
2875 (trunc) <code>rig..</code>, if the output is longer than
2877 Note 1: that truncating
2878 only works correctly with N >= 2.
2879 Note 2: spaces around the N and M (see below)
2880 values are optional.
2881 Note 3: Emojis and other wide characters
2882 will take two display columns, which may
2883 over-run column boundaries.
2884 Note 4: decomposed character combining marks
2885 may be misplaced at padding boundaries.
2888 <dt class="hdlist1
">
2889 <em>%<|( <M> )</em>
2893 make the next placeholder take at least until Mth
2894 display column, padding spaces on the right if necessary.
2895 Use negative M values for column positions measured
2896 from the right hand edge of the terminal window.
2899 <dt class="hdlist1
">
2900 <em>%>( <N> )</em>, <em>%>|( <M> )</em>
2904 similar to <em>%<( <N> )</em>, <em>%<|( <M> )</em> respectively,
2905 but padding spaces on the left
2908 <dt class="hdlist1
">
2909 <em>%>>( <N> )</em>, <em>%>>|( <M> )</em>
2913 similar to <em>%>( <N> )</em>, <em>%>|( <M> )</em>
2914 respectively, except that if the next
2915 placeholder takes more spaces than given and
2916 there are spaces on its left, use those
2920 <dt class="hdlist1
">
2921 <em>%><( <N> )</em>, <em>%><|( <M> )</em>
2925 similar to <em>%<( <N> )</em>, <em>%<|( <M> )</em>
2926 respectively, but padding both sides
2927 (i.e. the text is centered)
2934 Placeholders that expand to information extracted from the commit:
2936 <div class="dlist
"><dl>
2937 <dt class="hdlist1
">
2945 <dt class="hdlist1
">
2950 abbreviated commit hash
2953 <dt class="hdlist1
">
2961 <dt class="hdlist1
">
2966 abbreviated tree hash
2969 <dt class="hdlist1
">
2977 <dt class="hdlist1
">
2982 abbreviated parent hashes
2985 <dt class="hdlist1
">
2993 <dt class="hdlist1
">
2998 author name (respecting .mailmap, see <a href="git-shortlog.html
">git-shortlog(1)</a>
2999 or <a href="git-blame.html
">git-blame(1)</a>)
3002 <dt class="hdlist1
">
3010 <dt class="hdlist1
">
3015 author email (respecting .mailmap, see <a href="git-shortlog.html
">git-shortlog(1)</a>
3016 or <a href="git-blame.html
">git-blame(1)</a>)
3019 <dt class="hdlist1
">
3024 author email local-part (the part before the <em>@</em> sign)
3027 <dt class="hdlist1
">
3032 author local-part (see <em>%al</em>) respecting .mailmap, see
3033 <a href="git-shortlog.html
">git-shortlog(1)</a> or <a href="git-blame.html
">git-blame(1)</a>)
3036 <dt class="hdlist1
">
3041 author date (format respects --date= option)
3044 <dt class="hdlist1
">
3049 author date, RFC2822 style
3052 <dt class="hdlist1
">
3057 author date, relative
3060 <dt class="hdlist1
">
3065 author date, UNIX timestamp
3068 <dt class="hdlist1
">
3073 author date, ISO 8601-like format
3076 <dt class="hdlist1
">
3081 author date, strict ISO 8601 format
3084 <dt class="hdlist1
">
3089 author date, short format (<code>YYYY-MM-DD</code>)
3092 <dt class="hdlist1
">
3097 author date, human style (like the <code>--date=human</code> option of
3098 <a href="git-rev-list.html
">git-rev-list(1)</a>)
3101 <dt class="hdlist1
">
3109 <dt class="hdlist1
">
3114 committer name (respecting .mailmap, see
3115 <a href="git-shortlog.html
">git-shortlog(1)</a> or <a href="git-blame.html
">git-blame(1)</a>)
3118 <dt class="hdlist1
">
3126 <dt class="hdlist1
">
3131 committer email (respecting .mailmap, see
3132 <a href="git-shortlog.html
">git-shortlog(1)</a> or <a href="git-blame.html
">git-blame(1)</a>)
3135 <dt class="hdlist1
">
3140 committer email local-part (the part before the <em>@</em> sign)
3143 <dt class="hdlist1
">
3148 committer local-part (see <em>%cl</em>) respecting .mailmap, see
3149 <a href="git-shortlog.html
">git-shortlog(1)</a> or <a href="git-blame.html
">git-blame(1)</a>)
3152 <dt class="hdlist1
">
3157 committer date (format respects --date= option)
3160 <dt class="hdlist1
">
3165 committer date, RFC2822 style
3168 <dt class="hdlist1
">
3173 committer date, relative
3176 <dt class="hdlist1
">
3181 committer date, UNIX timestamp
3184 <dt class="hdlist1
">
3189 committer date, ISO 8601-like format
3192 <dt class="hdlist1
">
3197 committer date, strict ISO 8601 format
3200 <dt class="hdlist1
">
3205 committer date, short format (<code>YYYY-MM-DD</code>)
3208 <dt class="hdlist1
">
3213 committer date, human style (like the <code>--date=human</code> option of
3214 <a href="git-rev-list.html
">git-rev-list(1)</a>)
3217 <dt class="hdlist1
">
3222 ref names, like the --decorate option of <a href="git-log.html
">git-log(1)</a>
3225 <dt class="hdlist1
">
3230 ref names without the " (
", ")
" wrapping.
3233 <dt class="hdlist1
">
3234 <em>%(describe[:options])</em>
3238 human-readable name, like
3239 <a href="git-describe.html
">git-describe(1)</a>; empty string for
3240 undescribable commits. The <code>describe</code> string
3241 may be followed by a colon and zero or more
3242 comma-separated options. Descriptions can be
3243 inconsistent when tags are added or removed at
3246 <div class="ulist
"><ul>
3249 <em>tags[=<bool-value>]</em>: Instead of only considering annotated tags,
3250 consider lightweight tags as well.
3255 <em>abbrev=<number></em>: Instead of using the default number of hexadecimal digits
3256 (which will vary according to the number of objects in the repository with a
3257 default of 7) of the abbreviated object name, use <number> digits, or as many
3258 digits as needed to form a unique object name.
3263 <em>match=<pattern></em>: Only consider tags matching the given
3264 <code>glob(7)</code> pattern, excluding the "refs/tags/
" prefix.
3269 <em>exclude=<pattern></em>: Do not consider tags matching the given
3270 <code>glob(7)</code> pattern, excluding the "refs/tags/
" prefix.
3275 <dt class="hdlist1
">
3280 ref name given on the command line by which the commit was reached
3281 (like <code>git log --source</code>), only works with <code>git log</code>
3284 <dt class="hdlist1
">
3292 <dt class="hdlist1
">
3300 <dt class="hdlist1
">
3305 sanitized subject line, suitable for a filename
3308 <dt class="hdlist1
">
3316 <dt class="hdlist1
">
3321 raw body (unwrapped subject and body)
3324 <dt class="hdlist1
">
3329 raw verification message from GPG for a signed commit
3332 <dt class="hdlist1
">
3337 show "G
" for a good (valid) signature,
3338 "B
" for a bad signature,
3339 "U
" for a good signature with unknown validity,
3340 "X
" for a good signature that has expired,
3341 "Y
" for a good signature made by an expired key,
3342 "R
" for a good signature made by a revoked key,
3343 "E
" if the signature cannot be checked (e.g. missing key)
3344 and "N
" for no signature
3347 <dt class="hdlist1
">
3352 show the name of the signer for a signed commit
3355 <dt class="hdlist1
">
3360 show the key used to sign a signed commit
3363 <dt class="hdlist1
">
3368 show the fingerprint of the key used to sign a signed commit
3371 <dt class="hdlist1
">
3376 show the fingerprint of the primary key whose subkey was used
3377 to sign a signed commit
3380 <dt class="hdlist1
">
3385 show the trust level for the key used to sign a signed commit
3388 <dt class="hdlist1
">
3393 reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
3394 minutes ago}</code>; the format follows the rules described for the
3395 <code>-g</code> option. The portion before the <code>@</code> is the refname as
3396 given on the command line (so <code>git log -g refs/heads/master</code>
3397 would yield <code>refs/heads/master@{0}</code>).
3400 <dt class="hdlist1
">
3405 shortened reflog selector; same as <code>%gD</code>, but the refname
3406 portion is shortened for human readability (so
3407 <code>refs/heads/master</code> becomes just <code>master</code>).
3410 <dt class="hdlist1
">
3415 reflog identity name
3418 <dt class="hdlist1
">
3423 reflog identity name (respecting .mailmap, see
3424 <a href="git-shortlog.html
">git-shortlog(1)</a> or <a href="git-blame.html
">git-blame(1)</a>)
3427 <dt class="hdlist1
">
3432 reflog identity email
3435 <dt class="hdlist1
">
3440 reflog identity email (respecting .mailmap, see
3441 <a href="git-shortlog.html
">git-shortlog(1)</a> or <a href="git-blame.html
">git-blame(1)</a>)
3444 <dt class="hdlist1
">
3452 <dt class="hdlist1
">
3453 <em>%(trailers[:options])</em>
3457 display the trailers of the body as
3459 <a href="git-interpret-trailers.html
">git-interpret-trailers(1)</a>. The
3460 <code>trailers</code> string may be followed by a colon
3461 and zero or more comma-separated options.
3462 If any option is provided multiple times the
3463 last occurrence wins.
3465 <div class="ulist
"><ul>
3468 <em>key=<key></em>: only show trailers with specified <key>. Matching is done
3469 case-insensitively and trailing colon is optional. If option is
3470 given multiple times trailer lines matching any of the keys are
3471 shown. This option automatically enables the <code>only</code> option so that
3472 non-trailer lines in the trailer block are hidden. If that is not
3473 desired it can be disabled with <code>only=false</code>. E.g.,
3474 <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
3475 <code>Reviewed-by</code>.
3480 <em>only[=<bool>]</em>: select whether non-trailer lines from the trailer
3481 block should be included.
3486 <em>separator=<sep></em>: specify a separator inserted between trailer
3487 lines. When this option is not given each trailer line is
3488 terminated with a line feed character. The string <sep> may contain
3489 the literal formatting codes described above. To use comma as
3490 separator one must use <code>%x2C</code> as it would otherwise be parsed as
3491 next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
3492 shows all trailer lines whose key is "Ticket
" separated by a comma
3498 <em>unfold[=<bool>]</em>: make it behave as if interpret-trailer’s <code>--unfold</code>
3499 option was given. E.g.,
3500 <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.
3505 <em>keyonly[=<bool>]</em>: only show the key part of the trailer.
3510 <em>valueonly[=<bool>]</em>: only show the value part of the trailer.
3515 <em>key_value_separator=<sep></em>: specify a separator inserted between
3516 trailer lines. When this option is not given each trailer key-value
3517 pair is separated by ":
". Otherwise it shares the same semantics
3518 as <em>separator=<sep></em> above.
3528 <div class="admonitionblock
">
3531 <div class="title
">Note</div>
3533 <td class="content
">Some placeholders may depend on other options given to the
3534 revision traversal engine. For example, the <code>%g*</code> reflog options will
3535 insert an empty string unless we are traversing reflog entries (e.g., by
3536 <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short
"
3537 decoration format if <code>--decorate</code> was not already provided on the command
3541 <div class="paragraph
"><p>The boolean options accept an optional value <code>[=<bool-value>]</code>. The values
3542 <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean
"
3543 sub-section in "EXAMPLES
" in <a href="git-config.html
">git-config(1)</a>. If a boolean
3544 option is given with no value, it’s enabled.</p></div>
3545 <div class="paragraph
"><p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
3546 is inserted immediately before the expansion if and only if the
3547 placeholder expands to a non-empty string.</p></div>
3548 <div class="paragraph
"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
3549 line-feeds immediately preceding the expansion are deleted if and only if the
3550 placeholder expands to an empty string.</p></div>
3551 <div class="paragraph
"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
3552 is inserted immediately before the expansion if and only if the
3553 placeholder expands to a non-empty string.</p></div>
3554 <div class="ulist
"><ul>
3559 <div class="paragraph
"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
3560 provides "terminator
" semantics instead of "separator
" semantics. In
3561 other words, each commit has the message terminator character (usually a
3562 newline) appended, rather than a separator placed between entries.
3563 This means that the final entry of a single-line format will be properly
3564 terminated with a new line, just as the "oneline
" format does.
3565 For example:</p></div>
3566 <div class="listingblock
">
3567 <div class="content
">
3568 <pre><code>$ git log -2 --pretty=format:%h 4da45bef \
3569 | perl -pe '$_ .= " -- NO NEWLINE\n
" unless /\n/'
3571 7134973 -- NO NEWLINE
3573 $ git log -2 --pretty=tformat:%h 4da45bef \
3574 | perl -pe '$_ .= " -- NO NEWLINE\n
" unless /\n/'
3576 7134973</code></pre>
3578 <div class="paragraph
"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
3579 as if it has <code>tformat:</code> in front of it. For example, these two are
3580 equivalent:</p></div>
3581 <div class="listingblock
">
3582 <div class="content
">
3583 <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef
3584 $ git log -2 --pretty=%h 4da45bef</code></pre>
3591 <h2 id="_examples
">EXAMPLES</h2>
3592 <div class="sectionbody
">
3593 <div class="ulist
"><ul>
3596 Print the list of commits reachable from the current branch.
3598 <div class="listingblock
">
3599 <div class="content
">
3600 <pre><code>git rev-list HEAD</code></pre>
3605 Print the list of commits on this branch, but not present in the
3608 <div class="listingblock
">
3609 <div class="content
">
3610 <pre><code>git rev-list @{upstream}..HEAD</code></pre>
3615 Format commits with their author and commit message (see also the
3616 porcelain <a href="git-log.html
">git-log(1)</a>).
3618 <div class="listingblock
">
3619 <div class="content
">
3620 <pre><code>git rev-list --format=medium HEAD</code></pre>
3625 Format commits along with their diffs (see also the porcelain
3626 <a href="git-log.html
">git-log(1)</a>, which can do this in a single process).
3628 <div class="listingblock
">
3629 <div class="content
">
3630 <pre><code>git rev-list HEAD |
3631 git diff-tree --stdin --format=medium -p</code></pre>
3636 Print the list of commits on the current branch that touched any
3637 file in the <code>Documentation</code> directory.
3639 <div class="listingblock
">
3640 <div class="content
">
3641 <pre><code>git rev-list HEAD -- Documentation/</code></pre>
3646 Print the list of commits authored by you in the past year, on
3647 any branch, tag, or other ref.
3649 <div class="listingblock
">
3650 <div class="content
">
3651 <pre><code>git rev-list --author=you@example.com --since=1.year.ago --all</code></pre>
3656 Print the list of objects reachable from the current branch (i.e., all
3657 commits and the blobs and trees they contain).
3659 <div class="listingblock
">
3660 <div class="content
">
3661 <pre><code>git rev-list --objects HEAD</code></pre>
3666 Compare the disk size of all reachable objects, versus those
3667 reachable from reflogs, versus the total packed size. This can tell
3668 you whether running <code>git repack -ad</code> might reduce the repository size
3669 (by dropping unreachable objects), and whether expiring reflogs might
3672 <div class="listingblock
">
3673 <div class="content
">
3674 <pre><code># reachable objects
3675 git rev-list --disk-usage --objects --all
3677 git rev-list --disk-usage --objects --all --reflog
3678 # total disk size used
3679 du -c .git/objects/pack/*.pack .git/objects/??/*
3680 # alternative to du: add up "size
" and "size-pack
" fields
3681 git count-objects -v</code></pre>
3686 Report the disk size of each branch, not including objects used by the
3687 current branch. This can find outliers that are contributing to a
3688 bloated repository size (e.g., because somebody accidentally committed
3689 large build artifacts).
3691 <div class="listingblock
">
3692 <div class="content
">
3693 <pre><code>git for-each-ref --format='%(refname)' |
3696 size=$(git rev-list --disk-usage --objects HEAD..$branch)
3697 echo "$size $branch
"
3699 sort -n</code></pre>
3704 Compare the on-disk size of branches in one group of refs, excluding
3705 another. If you co-mingle objects from multiple remotes in a single
3706 repository, this can show which remotes are contributing to the
3707 repository size (taking the size of <code>origin</code> as a baseline).
3709 <div class="listingblock
">
3710 <div class="content
">
3711 <pre><code>git rev-list --disk-usage --objects --remotes=$suspect --not --remotes=origin</code></pre>
3718 <h2 id="_git
">GIT</h2>
3719 <div class="sectionbody
">
3720 <div class="paragraph
"><p>Part of the <a href="git.html
">git(1)</a> suite</p></div>
3724 <div id="footnotes
"><hr /></div>
3726 <div id="footer-text
">
3728 2022-10-28 11:53:56 PDT