Autogenerated HTML docs for v1.7.7-rc2-4-g5ec82
[git/jnareb-git.git] / git-log.html
blob035484a565e3f542548b0e05c81f8c862e040ec9
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.5.2" />
7 <title>git-log(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-log(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-log -
578 Show commit logs
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git log</em> [&lt;options&gt;] [&lt;since&gt;..&lt;until&gt;] [[--] &lt;path&gt;&#8230;]</div>
587 <div class="verseblock-attribution">
588 </div></div>
589 </div>
590 <h2 id="_description">DESCRIPTION</h2>
591 <div class="sectionbody">
592 <div class="paragraph"><p>Shows the commit logs.</p></div>
593 <div class="paragraph"><p>The command takes options applicable to the <em>git rev-list</em>
594 command to control what is shown and how, and options applicable to
595 the <em>git diff-*</em> commands to control how the changes
596 each commit introduces are shown.</p></div>
597 </div>
598 <h2 id="_options">OPTIONS</h2>
599 <div class="sectionbody">
600 <div class="dlist"><dl>
601 <dt class="hdlist1">
602 -&lt;n&gt;
603 </dt>
604 <dd>
606 Limits the number of commits to show.
607 Note that this is a commit limiting option, see below.
608 </p>
609 </dd>
610 <dt class="hdlist1">
611 &lt;since&gt;..&lt;until&gt;
612 </dt>
613 <dd>
615 Show only commits between the named two commits. When
616 either &lt;since&gt; or &lt;until&gt; is omitted, it defaults to
617 <tt>HEAD</tt>, i.e. the tip of the current branch.
618 For a more complete list of ways to spell &lt;since&gt;
619 and &lt;until&gt;, see <a href="gitrevisions.html">gitrevisions(7)</a>.
620 </p>
621 </dd>
622 <dt class="hdlist1">
623 --follow
624 </dt>
625 <dd>
627 Continue listing the history of a file beyond renames
628 (works only for a single file).
629 </p>
630 </dd>
631 <dt class="hdlist1">
632 --no-decorate
633 </dt>
634 <dt class="hdlist1">
635 --decorate[=short|full|no]
636 </dt>
637 <dd>
639 Print out the ref names of any commits that are shown. If <em>short</em> is
640 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
641 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
642 full ref name (including prefix) will be printed. The default option
643 is <em>short</em>.
644 </p>
645 </dd>
646 <dt class="hdlist1">
647 --source
648 </dt>
649 <dd>
651 Print out the ref name given on the command line by which each
652 commit was reached.
653 </p>
654 </dd>
655 <dt class="hdlist1">
656 --full-diff
657 </dt>
658 <dd>
660 Without this flag, "git log -p &lt;path&gt;&#8230;" shows commits that
661 touch the specified paths, and diffs about the same specified
662 paths. With this, the full diff is shown for commits that touch
663 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
664 commits, and doesn&#8217;t limit diff for those commits.
665 </p>
666 <div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
667 produced by --stat etc.</p></div>
668 </dd>
669 <dt class="hdlist1">
670 --log-size
671 </dt>
672 <dd>
674 Before the log message print out its size in bytes. Intended
675 mainly for porcelain tools consumption. If git is unable to
676 produce a valid value size is set to zero.
677 Note that only message is considered, if also a diff is shown
678 its size is not included.
679 </p>
680 </dd>
681 <dt class="hdlist1">
682 [--] &lt;path&gt;&#8230;
683 </dt>
684 <dd>
686 Show only commits that are enough to explain how the files
687 that match the specified paths came to be. See "History
688 Simplification" below for details and other simplification
689 modes.
690 </p>
691 <div class="paragraph"><p>To prevent confusion with options and branch names, paths may need to
692 be prefixed with "-- " to separate them from options or refnames.</p></div>
693 </dd>
694 </dl></div>
695 <h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
696 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
697 special notations explained in the description, additional commit
698 limiting may be applied. Note that they are applied before commit
699 ordering and formatting options, such as <em>--reverse</em>.</p></div>
700 <div class="dlist"><dl>
701 <dt class="hdlist1">
702 -n <em>number</em>
703 </dt>
704 <dt class="hdlist1">
705 --max-count=&lt;number&gt;
706 </dt>
707 <dd>
709 Limit the number of commits to output.
710 </p>
711 </dd>
712 <dt class="hdlist1">
713 --skip=&lt;number&gt;
714 </dt>
715 <dd>
717 Skip <em>number</em> commits before starting to show the commit output.
718 </p>
719 </dd>
720 <dt class="hdlist1">
721 --since=&lt;date&gt;
722 </dt>
723 <dt class="hdlist1">
724 --after=&lt;date&gt;
725 </dt>
726 <dd>
728 Show commits more recent than a specific date.
729 </p>
730 </dd>
731 <dt class="hdlist1">
732 --until=&lt;date&gt;
733 </dt>
734 <dt class="hdlist1">
735 --before=&lt;date&gt;
736 </dt>
737 <dd>
739 Show commits older than a specific date.
740 </p>
741 </dd>
742 <dt class="hdlist1">
743 --author=&lt;pattern&gt;
744 </dt>
745 <dt class="hdlist1">
746 --committer=&lt;pattern&gt;
747 </dt>
748 <dd>
750 Limit the commits output to ones with author/committer
751 header lines that match the specified pattern (regular expression).
752 </p>
753 </dd>
754 <dt class="hdlist1">
755 --grep=&lt;pattern&gt;
756 </dt>
757 <dd>
759 Limit the commits output to ones with log message that
760 matches the specified pattern (regular expression).
761 </p>
762 </dd>
763 <dt class="hdlist1">
764 --all-match
765 </dt>
766 <dd>
768 Limit the commits output to ones that match all given --grep,
769 --author and --committer instead of ones that match at least one.
770 </p>
771 </dd>
772 <dt class="hdlist1">
774 </dt>
775 <dt class="hdlist1">
776 --regexp-ignore-case
777 </dt>
778 <dd>
780 Match the regexp limiting patterns without regard to letters case.
781 </p>
782 </dd>
783 <dt class="hdlist1">
785 </dt>
786 <dt class="hdlist1">
787 --extended-regexp
788 </dt>
789 <dd>
791 Consider the limiting patterns to be extended regular expressions
792 instead of the default basic regular expressions.
793 </p>
794 </dd>
795 <dt class="hdlist1">
797 </dt>
798 <dt class="hdlist1">
799 --fixed-strings
800 </dt>
801 <dd>
803 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
804 pattern as a regular expression).
805 </p>
806 </dd>
807 <dt class="hdlist1">
808 --remove-empty
809 </dt>
810 <dd>
812 Stop when a given path disappears from the tree.
813 </p>
814 </dd>
815 <dt class="hdlist1">
816 --merges
817 </dt>
818 <dd>
820 Print only merge commits. This is exactly the same as <tt>--min-parents=2</tt>.
821 </p>
822 </dd>
823 <dt class="hdlist1">
824 --no-merges
825 </dt>
826 <dd>
828 Do not print commits with more than one parent. This is
829 exactly the same as <tt>--max-parents=1</tt>.
830 </p>
831 </dd>
832 <dt class="hdlist1">
833 --min-parents=&lt;number&gt;
834 </dt>
835 <dt class="hdlist1">
836 --max-parents=&lt;number&gt;
837 </dt>
838 <dt class="hdlist1">
839 --no-min-parents
840 </dt>
841 <dt class="hdlist1">
842 --no-max-parents
843 </dt>
844 <dd>
846 Show only commits which have at least (or at most) that many
847 commits. In particular, <tt>--max-parents=1</tt> is the same as <tt>--no-merges</tt>,
848 <tt>--min-parents=2</tt> is the same as <tt>--merges</tt>. <tt>--max-parents=0</tt>
849 gives all root commits and <tt>--min-parents=3</tt> all octopus merges.
850 </p>
851 <div class="paragraph"><p><tt>--no-min-parents</tt> and <tt>--no-max-parents</tt> reset these limits (to no limit)
852 again. Equivalent forms are <tt>--min-parents=0</tt> (any commit has 0 or more
853 parents) and <tt>--max-parents=-1</tt> (negative numbers denote no upper limit).</p></div>
854 </dd>
855 <dt class="hdlist1">
856 --first-parent
857 </dt>
858 <dd>
860 Follow only the first parent commit upon seeing a merge
861 commit. This option can give a better overview when
862 viewing the evolution of a particular topic branch,
863 because merges into a topic branch tend to be only about
864 adjusting to updated upstream from time to time, and
865 this option allows you to ignore the individual commits
866 brought in to your history by such a merge.
867 </p>
868 </dd>
869 <dt class="hdlist1">
870 --not
871 </dt>
872 <dd>
874 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
875 for all following revision specifiers, up to the next <em>--not</em>.
876 </p>
877 </dd>
878 <dt class="hdlist1">
879 --all
880 </dt>
881 <dd>
883 Pretend as if all the refs in <tt>refs/</tt> are listed on the
884 command line as <em>&lt;commit&gt;</em>.
885 </p>
886 </dd>
887 <dt class="hdlist1">
888 --branches[=&lt;pattern&gt;]
889 </dt>
890 <dd>
892 Pretend as if all the refs in <tt>refs/heads</tt> are listed
893 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
894 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
895 <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
896 </p>
897 </dd>
898 <dt class="hdlist1">
899 --tags[=&lt;pattern&gt;]
900 </dt>
901 <dd>
903 Pretend as if all the refs in <tt>refs/tags</tt> are listed
904 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
905 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em><strong></em>,
906 or <em>[</em>, <em>/</strong></em> at the end is implied.
907 </p>
908 </dd>
909 <dt class="hdlist1">
910 --remotes[=&lt;pattern&gt;]
911 </dt>
912 <dd>
914 Pretend as if all the refs in <tt>refs/remotes</tt> are listed
915 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
916 remote-tracking branches to ones matching given shell glob.
917 If pattern lacks <em>?</em>, <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
918 </p>
919 </dd>
920 <dt class="hdlist1">
921 --glob=&lt;glob-pattern&gt;
922 </dt>
923 <dd>
925 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
926 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
927 is automatically prepended if missing. If pattern lacks <em>?</em>, <em><strong></em>,
928 or <em>[</em>, <em>/</strong></em> at the end is implied.
929 </p>
930 </dd>
931 <dt class="hdlist1">
932 --ignore-missing
933 </dt>
934 <dd>
936 Upon seeing an invalid object name in the input, pretend as if
937 the bad input was not given.
938 </p>
939 </dd>
940 <dt class="hdlist1">
941 --bisect
942 </dt>
943 <dd>
945 Pretend as if the bad bisection ref <tt>refs/bisect/bad</tt>
946 was listed and as if it was followed by <tt>--not</tt> and the good
947 bisection refs <tt>refs/bisect/good-*</tt> on the command
948 line.
949 </p>
950 </dd>
951 <dt class="hdlist1">
952 --stdin
953 </dt>
954 <dd>
956 In addition to the <em>&lt;commit&gt;</em> listed on the command
957 line, read them from the standard input. If a <em>--</em> separator is
958 seen, stop reading commits and start reading paths to limit the
959 result.
960 </p>
961 </dd>
962 <dt class="hdlist1">
963 --cherry-mark
964 </dt>
965 <dd>
967 Like <tt>--cherry-pick</tt> (see below) but mark equivalent commits
968 with <tt>=</tt> rather than omitting them, and inequivalent ones with <tt>+</tt>.
969 </p>
970 </dd>
971 <dt class="hdlist1">
972 --cherry-pick
973 </dt>
974 <dd>
976 Omit any commit that introduces the same change as
977 another commit on the "other side" when the set of
978 commits are limited with symmetric difference.
979 </p>
980 <div class="paragraph"><p>For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
981 to list all commits on only one side of them is with
982 <tt>--left-right</tt> (see the example below in the description of
983 the <tt>--left-right</tt> option). It however shows the commits that were cherry-picked
984 from the other branch (for example, "3rd on b" may be cherry-picked
985 from branch A). With this option, such pairs of commits are
986 excluded from the output.</p></div>
987 </dd>
988 <dt class="hdlist1">
989 --left-only
990 </dt>
991 <dt class="hdlist1">
992 --right-only
993 </dt>
994 <dd>
996 List only commits on the respective side of a symmetric range,
997 i.e. only those which would be marked <tt>&lt;</tt> resp. <tt>&gt;</tt> by
998 <tt>--left-right</tt>.
999 </p>
1000 <div class="paragraph"><p>For example, <tt>--cherry-pick --right-only A&#8230;B</tt> omits those
1001 commits from <tt>B</tt> which are in <tt>A</tt> or are patch-equivalent to a commit in
1002 <tt>A</tt>. In other words, this lists the <tt>&#43;</tt> commits from <tt>git cherry A B</tt>.
1003 More precisely, <tt>--cherry-pick --right-only --no-merges</tt> gives the exact
1004 list.</p></div>
1005 </dd>
1006 <dt class="hdlist1">
1007 --cherry
1008 </dt>
1009 <dd>
1011 A synonym for <tt>--right-only --cherry-mark --no-merges</tt>; useful to
1012 limit the output to the commits on our side and mark those that
1013 have been applied to the other side of a forked history with
1014 <tt>git log --cherry upstream&#8230;mybranch</tt>, similar to
1015 <tt>git cherry upstream mybranch</tt>.
1016 </p>
1017 </dd>
1018 <dt class="hdlist1">
1020 </dt>
1021 <dt class="hdlist1">
1022 --walk-reflogs
1023 </dt>
1024 <dd>
1026 Instead of walking the commit ancestry chain, walk
1027 reflog entries from the most recent one to older ones.
1028 When this option is used you cannot specify commits to
1029 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
1030 nor <em>commit1...commit2</em> notations cannot be used).
1031 </p>
1032 <div class="paragraph"><p>With <em>--pretty</em> format other than oneline (for obvious reasons),
1033 this causes the output to have two extra lines of information
1034 taken from the reflog. By default, <em>commit@{Nth}</em> notation is
1035 used in the output. When the starting commit is specified as
1036 <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
1037 instead. Under <em>--pretty=oneline</em>, the commit message is
1038 prefixed with this information on the same line.
1039 This option cannot be combined with <em>--reverse</em>.
1040 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
1041 </dd>
1042 <dt class="hdlist1">
1043 --merge
1044 </dt>
1045 <dd>
1047 After a failed merge, show refs that touch files having a
1048 conflict and don&#8217;t exist on all heads to merge.
1049 </p>
1050 </dd>
1051 <dt class="hdlist1">
1052 --boundary
1053 </dt>
1054 <dd>
1056 Output uninteresting commits at the boundary, which are usually
1057 not shown.
1058 </p>
1059 </dd>
1060 </dl></div>
1061 <h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
1062 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
1063 commits modifying a particular &lt;path&gt;. But there are two parts of
1064 <em>History Simplification</em>, one part is selecting the commits and the other
1065 is how to do it, as there are various strategies to simplify the history.</p></div>
1066 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
1067 <div class="dlist"><dl>
1068 <dt class="hdlist1">
1069 &lt;paths&gt;
1070 </dt>
1071 <dd>
1073 Commits modifying the given &lt;paths&gt; are selected.
1074 </p>
1075 </dd>
1076 <dt class="hdlist1">
1077 --simplify-by-decoration
1078 </dt>
1079 <dd>
1081 Commits that are referred by some branch or tag are selected.
1082 </p>
1083 </dd>
1084 </dl></div>
1085 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
1086 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
1087 <div class="dlist"><dl>
1088 <dt class="hdlist1">
1089 Default mode
1090 </dt>
1091 <dd>
1093 Simplifies the history to the simplest history explaining the
1094 final state of the tree. Simplest because it prunes some side
1095 branches if the end result is the same (i.e. merging branches
1096 with the same content)
1097 </p>
1098 </dd>
1099 <dt class="hdlist1">
1100 --full-history
1101 </dt>
1102 <dd>
1104 Same as the default mode, but does not prune some history.
1105 </p>
1106 </dd>
1107 <dt class="hdlist1">
1108 --dense
1109 </dt>
1110 <dd>
1112 Only the selected commits are shown, plus some to have a
1113 meaningful history.
1114 </p>
1115 </dd>
1116 <dt class="hdlist1">
1117 --sparse
1118 </dt>
1119 <dd>
1121 All commits in the simplified history are shown.
1122 </p>
1123 </dd>
1124 <dt class="hdlist1">
1125 --simplify-merges
1126 </dt>
1127 <dd>
1129 Additional option to <em>--full-history</em> to remove some needless
1130 merges from the resulting history, as there are no selected
1131 commits contributing to this merge.
1132 </p>
1133 </dd>
1134 <dt class="hdlist1">
1135 --ancestry-path
1136 </dt>
1137 <dd>
1139 When given a range of commits to display (e.g. <em>commit1..commit2</em>
1140 or <em>commit2 &#94;commit1</em>), only display commits that exist
1141 directly on the ancestry chain between the <em>commit1</em> and
1142 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
1143 and ancestors of <em>commit2</em>.
1144 </p>
1145 </dd>
1146 </dl></div>
1147 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
1148 <div class="paragraph"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
1149 that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
1150 filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
1151 <div class="paragraph"><p>In the following, we will always refer to the same example history to
1152 illustrate the differences between simplification settings. We assume
1153 that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
1154 <div class="listingblock">
1155 <div class="content">
1156 <pre><tt> .-A---M---N---O---P
1157 / / / / /
1158 I B C D E
1159 \ / / / /
1160 `-------------'</tt></pre>
1161 </div></div>
1162 <div class="paragraph"><p>The horizontal line of history A---P is taken to be the first parent of
1163 each merge. The commits are:</p></div>
1164 <div class="ulist"><ul>
1165 <li>
1167 <tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
1168 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
1169 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
1170 </p>
1171 </li>
1172 <li>
1174 In <tt>A</tt>, <tt>foo</tt> contains just "foo".
1175 </p>
1176 </li>
1177 <li>
1179 <tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
1180 hence TREESAME to all parents.
1181 </p>
1182 </li>
1183 <li>
1185 <tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
1186 so it is not TREESAME to any parent.
1187 </p>
1188 </li>
1189 <li>
1191 <tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
1192 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
1193 </p>
1194 </li>
1195 <li>
1197 <tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
1198 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
1199 TREESAME to all parents.
1200 </p>
1201 </li>
1202 </ul></div>
1203 <div class="paragraph"><p><em>rev-list</em> walks backwards through history, including or excluding
1204 commits based on whether <em>--full-history</em> and/or parent rewriting
1205 (via <em>--parents</em> or <em>--children</em>) are used. The following settings
1206 are available.</p></div>
1207 <div class="dlist"><dl>
1208 <dt class="hdlist1">
1209 Default mode
1210 </dt>
1211 <dd>
1213 Commits are included if they are not TREESAME to any parent
1214 (though this can be changed, see <em>--sparse</em> below). If the
1215 commit was a merge, and it was TREESAME to one parent, follow
1216 only that parent. (Even if there are several TREESAME
1217 parents, follow only one of them.) Otherwise, follow all
1218 parents.
1219 </p>
1220 <div class="paragraph"><p>This results in:</p></div>
1221 <div class="listingblock">
1222 <div class="content">
1223 <pre><tt> .-A---N---O
1224 / / /
1225 I---------D</tt></pre>
1226 </div></div>
1227 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1228 available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
1229 considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
1230 empty tree, so <tt>I</tt> is !TREESAME.</p></div>
1231 <div class="paragraph"><p>Parent/child relations are only visible with --parents, but that does
1232 not affect the commits selected in default mode, so we have shown the
1233 parent lines.</p></div>
1234 </dd>
1235 <dt class="hdlist1">
1236 --full-history without parent rewriting
1237 </dt>
1238 <dd>
1240 This mode differs from the default in one point: always follow
1241 all parents of a merge, even if it is TREESAME to one of them.
1242 Even if more than one side of the merge has commits that are
1243 included, this does not imply that the merge itself is! In
1244 the example, we get
1245 </p>
1246 <div class="listingblock">
1247 <div class="content">
1248 <pre><tt> I A B N D O</tt></pre>
1249 </div></div>
1250 <div class="paragraph"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
1251 <tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
1252 do not appear.</p></div>
1253 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1254 about the parent/child relationships between the commits, so we show
1255 them disconnected.</p></div>
1256 </dd>
1257 <dt class="hdlist1">
1258 --full-history with parent rewriting
1259 </dt>
1260 <dd>
1262 Ordinary commits are only included if they are !TREESAME
1263 (though this can be changed, see <em>--sparse</em> below).
1264 </p>
1265 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1266 Along each parent, prune away commits that are not included
1267 themselves. This results in</p></div>
1268 <div class="listingblock">
1269 <div class="content">
1270 <pre><tt> .-A---M---N---O---P
1271 / / / / /
1272 I B / D /
1273 \ / / / /
1274 `-------------'</tt></pre>
1275 </div></div>
1276 <div class="paragraph"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
1277 was pruned away because it is TREESAME, but the parent list of P was
1278 rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
1279 <tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
1280 </dd>
1281 </dl></div>
1282 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1283 affects inclusion:</p></div>
1284 <div class="dlist"><dl>
1285 <dt class="hdlist1">
1286 --dense
1287 </dt>
1288 <dd>
1290 Commits that are walked are included if they are not TREESAME
1291 to any parent.
1292 </p>
1293 </dd>
1294 <dt class="hdlist1">
1295 --sparse
1296 </dt>
1297 <dd>
1299 All commits that are walked are included.
1300 </p>
1301 <div class="paragraph"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
1302 one of the parents is TREESAME, we follow only that one, so the other
1303 sides of the merge are never walked.</p></div>
1304 </dd>
1305 <dt class="hdlist1">
1306 --simplify-merges
1307 </dt>
1308 <dd>
1310 First, build a history graph in the same way that
1311 <em>--full-history</em> with parent rewriting does (see above).
1312 </p>
1313 <div class="paragraph"><p>Then simplify each commit &#8216;C` to its replacement <tt>C&#8217;</tt> in the final
1314 history according to the following rules:</p></div>
1315 <div class="ulist"><ul>
1316 <li>
1318 Set &#8216;C&#8217;` to <tt>C</tt>.
1319 </p>
1320 </li>
1321 <li>
1323 Replace each parent &#8216;P` of <tt>C&#8217;</tt> with its simplification &#8216;P&#8217;`. In
1324 the process, drop parents that are ancestors of other parents, and
1325 remove duplicates.
1326 </p>
1327 </li>
1328 <li>
1330 If after this parent rewriting, &#8216;C&#8217;` is a root or merge commit (has
1331 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1332 Otherwise, it is replaced with its only parent.
1333 </p>
1334 </li>
1335 </ul></div>
1336 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1337 <em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1338 <div class="listingblock">
1339 <div class="content">
1340 <pre><tt> .-A---M---N---O
1341 / / /
1342 I B D
1343 \ / /
1344 `---------'</tt></pre>
1345 </div></div>
1346 <div class="paragraph"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
1347 <div class="ulist"><ul>
1348 <li>
1350 <tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1351 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.
1352 </p>
1353 </li>
1354 <li>
1356 <tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1357 removed completely, because it had one parent and is TREESAME.
1358 </p>
1359 </li>
1360 </ul></div>
1361 </dd>
1362 </dl></div>
1363 <div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1364 <div class="dlist"><dl>
1365 <dt class="hdlist1">
1366 --ancestry-path
1367 </dt>
1368 <dd>
1370 Limit the displayed commits to those directly on the ancestry
1371 chain between the "from" and "to" commits in the given commit
1372 range. I.e. only display commits that are ancestor of the "to"
1373 commit, and descendants of the "from" commit.
1374 </p>
1375 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1376 <div class="listingblock">
1377 <div class="content">
1378 <pre><tt> D---E-------F
1379 / \ \
1380 B---C---G---H---I---J
1382 A-------K---------------L--M</tt></pre>
1383 </div></div>
1384 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <tt>M</tt>,
1385 but excludes the ones that are ancestors of <tt>D</tt>. This is useful to see
1386 what happened to the history leading to <tt>M</tt> since <tt>D</tt>, in the sense
1387 that "what does <tt>M</tt> have that did not exist in <tt>D</tt>". The result in this
1388 example would be all the commits, except <tt>A</tt> and <tt>B</tt> (and <tt>D</tt> itself,
1389 of course).</p></div>
1390 <div class="paragraph"><p>When we want to find out what commits in <tt>M</tt> are contaminated with the
1391 bug introduced by <tt>D</tt> and need fixing, however, we might want to view
1392 only the subset of <em>D..M</em> that are actually descendants of <tt>D</tt>, i.e.
1393 excluding <tt>C</tt> and <tt>K</tt>. This is exactly what the <em>--ancestry-path</em>
1394 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1395 <div class="listingblock">
1396 <div class="content">
1397 <pre><tt> E-------F
1399 G---H---I---J
1401 L--M</tt></pre>
1402 </div></div>
1403 </dd>
1404 </dl></div>
1405 <div class="paragraph"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
1406 big picture of the topology of the history, by omitting commits
1407 that are not referenced by tags. Commits are marked as !TREESAME
1408 (in other words, kept after history simplification rules described
1409 above) if (1) they are referenced by tags, or (2) they change the
1410 contents of the paths given on the command line. All other
1411 commits are marked as TREESAME (subject to be simplified away).</p></div>
1412 <h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1413 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1414 <div class="dlist"><dl>
1415 <dt class="hdlist1">
1416 --topo-order
1417 </dt>
1418 <dd>
1420 This option makes them appear in topological order (i.e.
1421 descendant commits are shown before their parents).
1422 </p>
1423 </dd>
1424 <dt class="hdlist1">
1425 --date-order
1426 </dt>
1427 <dd>
1429 This option is similar to <em>--topo-order</em> in the sense that no
1430 parent comes before all of its children, but otherwise things
1431 are still ordered in the commit timestamp order.
1432 </p>
1433 </dd>
1434 <dt class="hdlist1">
1435 --reverse
1436 </dt>
1437 <dd>
1439 Output the commits in reverse order.
1440 Cannot be combined with <em>--walk-reflogs</em>.
1441 </p>
1442 </dd>
1443 </dl></div>
1444 <h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1445 <div class="paragraph"><p>These options are mostly targeted for packing of git repositories.</p></div>
1446 <div class="dlist"><dl>
1447 <dt class="hdlist1">
1448 --objects
1449 </dt>
1450 <dd>
1452 Print the object IDs of any object referenced by the listed
1453 commits. <em>--objects foo ^bar</em> thus means "send me
1454 all object IDs which I need to download if I have the commit
1455 object <em>bar</em>, but not <em>foo</em>".
1456 </p>
1457 </dd>
1458 <dt class="hdlist1">
1459 --objects-edge
1460 </dt>
1461 <dd>
1463 Similar to <em>--objects</em>, but also print the IDs of excluded
1464 commits prefixed with a "-" character. This is used by
1465 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1466 objects in deltified form based on objects contained in these
1467 excluded commits to reduce network traffic.
1468 </p>
1469 </dd>
1470 <dt class="hdlist1">
1471 --unpacked
1472 </dt>
1473 <dd>
1475 Only useful with <em>--objects</em>; print the object IDs that are not
1476 in packs.
1477 </p>
1478 </dd>
1479 <dt class="hdlist1">
1480 --no-walk
1481 </dt>
1482 <dd>
1484 Only show the given revs, but do not traverse their ancestors.
1485 </p>
1486 </dd>
1487 <dt class="hdlist1">
1488 --do-walk
1489 </dt>
1490 <dd>
1492 Overrides a previous --no-walk.
1493 </p>
1494 </dd>
1495 </dl></div>
1496 <h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
1497 <div class="dlist"><dl>
1498 <dt class="hdlist1">
1499 --pretty[=&lt;format&gt;]
1500 </dt>
1501 <dt class="hdlist1">
1502 --format=&lt;format&gt;
1503 </dt>
1504 <dd>
1506 Pretty-print the contents of the commit logs in a given format,
1507 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1508 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1509 the "PRETTY FORMATS" section for some additional details for each
1510 format. When omitted, the format defaults to <em>medium</em>.
1511 </p>
1512 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
1513 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
1514 </dd>
1515 <dt class="hdlist1">
1516 --abbrev-commit
1517 </dt>
1518 <dd>
1520 Instead of showing the full 40-byte hexadecimal commit object
1521 name, show only a partial prefix. Non default number of
1522 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1523 diff output, if it is displayed).
1524 </p>
1525 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1526 people using 80-column terminals.</p></div>
1527 </dd>
1528 <dt class="hdlist1">
1529 --no-abbrev-commit
1530 </dt>
1531 <dd>
1533 Show the full 40-byte hexadecimal commit object name. This negates
1534 <tt>--abbrev-commit</tt> and those options which imply it such as
1535 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1536 </p>
1537 </dd>
1538 <dt class="hdlist1">
1539 --oneline
1540 </dt>
1541 <dd>
1543 This is a shorthand for "--pretty=oneline --abbrev-commit"
1544 used together.
1545 </p>
1546 </dd>
1547 <dt class="hdlist1">
1548 --encoding[=&lt;encoding&gt;]
1549 </dt>
1550 <dd>
1552 The commit objects record the encoding used for the log message
1553 in their encoding header; this option can be used to tell the
1554 command to re-code the commit log message in the encoding
1555 preferred by the user. For non plumbing commands this
1556 defaults to UTF-8.
1557 </p>
1558 </dd>
1559 <dt class="hdlist1">
1560 --notes[=&lt;ref&gt;]
1561 </dt>
1562 <dd>
1564 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1565 commit, when showing the commit log message. This is the default
1566 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
1567 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given
1568 on the command line.
1569 </p>
1570 <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1571 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
1572 environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
1573 <div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
1574 default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it
1575 is not qualified.</p></div>
1576 <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1577 being displayed. Examples: "--notes=foo" will show only notes from
1578 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
1579 "refs/notes/foo" and from the default notes ref(s).</p></div>
1580 </dd>
1581 <dt class="hdlist1">
1582 --no-notes
1583 </dt>
1584 <dd>
1586 Do not show notes. This negates the above <tt>--notes</tt> option, by
1587 resetting the list of notes refs from which notes are shown.
1588 Options are parsed in the order given on the command line, so e.g.
1589 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1590 from "refs/notes/bar".
1591 </p>
1592 </dd>
1593 <dt class="hdlist1">
1594 --show-notes[=&lt;ref&gt;]
1595 </dt>
1596 <dt class="hdlist1">
1597 --[no-]standard-notes
1598 </dt>
1599 <dd>
1601 These options are deprecated. Use the above --notes/--no-notes
1602 options instead.
1603 </p>
1604 </dd>
1605 <dt class="hdlist1">
1606 --relative-date
1607 </dt>
1608 <dd>
1610 Synonym for <tt>--date=relative</tt>.
1611 </p>
1612 </dd>
1613 <dt class="hdlist1">
1614 --date=(relative|local|default|iso|rfc|short|raw)
1615 </dt>
1616 <dd>
1618 Only takes effect for dates shown in human-readable format, such
1619 as when using "--pretty". <tt>log.date</tt> config variable sets a default
1620 value for log command&#8217;s --date option.
1621 </p>
1622 <div class="paragraph"><p><tt>--date=relative</tt> shows dates relative to the current time,
1623 e.g. "2 hours ago".</p></div>
1624 <div class="paragraph"><p><tt>--date=local</tt> shows timestamps in user&#8217;s local timezone.</p></div>
1625 <div class="paragraph"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
1626 <div class="paragraph"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
1627 format, often found in E-mail messages.</p></div>
1628 <div class="paragraph"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
1629 <div class="paragraph"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div>
1630 <div class="paragraph"><p><tt>--date=default</tt> shows timestamps in the original timezone
1631 (either committer&#8217;s or author&#8217;s).</p></div>
1632 </dd>
1633 <dt class="hdlist1">
1634 --parents
1635 </dt>
1636 <dd>
1638 Print also the parents of the commit (in the form "commit parent&#8230;").
1639 Also enables parent rewriting, see <em>History Simplification</em> below.
1640 </p>
1641 </dd>
1642 <dt class="hdlist1">
1643 --children
1644 </dt>
1645 <dd>
1647 Print also the children of the commit (in the form "commit child&#8230;").
1648 Also enables parent rewriting, see <em>History Simplification</em> below.
1649 </p>
1650 </dd>
1651 <dt class="hdlist1">
1652 --left-right
1653 </dt>
1654 <dd>
1656 Mark which side of a symmetric diff a commit is reachable from.
1657 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
1658 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
1659 commits are prefixed with <tt>-</tt>.
1660 </p>
1661 <div class="paragraph"><p>For example, if you have this topology:</p></div>
1662 <div class="listingblock">
1663 <div class="content">
1664 <pre><tt> y---b---b branch B
1665 / \ /
1667 / / \
1668 o---x---a---a branch A</tt></pre>
1669 </div></div>
1670 <div class="paragraph"><p>you would get an output like this:</p></div>
1671 <div class="listingblock">
1672 <div class="content">
1673 <pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
1675 &gt;bbbbbbb... 3rd on b
1676 &gt;bbbbbbb... 2nd on b
1677 &lt;aaaaaaa... 3rd on a
1678 &lt;aaaaaaa... 2nd on a
1679 -yyyyyyy... 1st on b
1680 -xxxxxxx... 1st on a</tt></pre>
1681 </div></div>
1682 </dd>
1683 <dt class="hdlist1">
1684 --graph
1685 </dt>
1686 <dd>
1688 Draw a text-based graphical representation of the commit history
1689 on the left hand side of the output. This may cause extra lines
1690 to be printed in between commits, in order for the graph history
1691 to be drawn properly.
1692 </p>
1693 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div>
1694 <div class="paragraph"><p>This implies the <em>--topo-order</em> option by default, but the
1695 <em>--date-order</em> option may also be specified.</p></div>
1696 </dd>
1697 </dl></div>
1698 <h3 id="_diff_formatting">Diff Formatting</h3><div style="clear:left"></div>
1699 <div class="paragraph"><p>Below are listed options that control the formatting of diff output.
1700 Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
1701 options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div>
1702 <div class="dlist"><dl>
1703 <dt class="hdlist1">
1705 </dt>
1706 <dd>
1708 With this option, diff output for a merge commit
1709 shows the differences from each of the parents to the merge result
1710 simultaneously instead of showing pairwise diff between a parent
1711 and the result one at a time. Furthermore, it lists only files
1712 which were modified from all parents.
1713 </p>
1714 </dd>
1715 <dt class="hdlist1">
1716 --cc
1717 </dt>
1718 <dd>
1720 This flag implies the <em>-c</em> options and further compresses the
1721 patch output by omitting uninteresting hunks whose contents in
1722 the parents have only two variants and the merge result picks
1723 one of them without modification.
1724 </p>
1725 </dd>
1726 <dt class="hdlist1">
1728 </dt>
1729 <dd>
1731 This flag makes the merge commits show the full diff like
1732 regular commits; for each merge parent, a separate log entry
1733 and diff is generated. An exception is that only diff against
1734 the first parent is shown when <em>--first-parent</em> option is given;
1735 in that case, the output represents the changes the merge
1736 brought <em>into</em> the then-current branch.
1737 </p>
1738 </dd>
1739 <dt class="hdlist1">
1741 </dt>
1742 <dd>
1744 Show recursive diffs.
1745 </p>
1746 </dd>
1747 <dt class="hdlist1">
1749 </dt>
1750 <dd>
1752 Show the tree objects in the diff output. This implies <em>-r</em>.
1753 </p>
1754 </dd>
1755 <dt class="hdlist1">
1757 </dt>
1758 <dd>
1760 Suppress diff output.
1761 </p>
1762 </dd>
1763 </dl></div>
1764 </div>
1765 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
1766 <div class="sectionbody">
1767 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
1768 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1769 inserted before the <em>Author:</em> line. This line begins with
1770 "Merge: " and the sha1s of ancestral commits are printed,
1771 separated by spaces. Note that the listed commits may not
1772 necessarily be the list of the <strong>direct</strong> parent commits if you
1773 have limited your view of history: for example, if you are
1774 only interested in changes related to a certain directory or
1775 file.</p></div>
1776 <div class="paragraph"><p>There are several built-in formats, and you can define
1777 additional formats by setting a pretty.&lt;name&gt;
1778 config option to either another format name, or a
1779 <em>format:</em> string, as described below (see
1780 <a href="git-config.html">git-config(1)</a>). Here are the details of the
1781 built-in formats:</p></div>
1782 <div class="ulist"><ul>
1783 <li>
1785 <em>oneline</em>
1786 </p>
1787 <div class="literalblock">
1788 <div class="content">
1789 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1790 </div></div>
1791 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
1792 </li>
1793 <li>
1795 <em>short</em>
1796 </p>
1797 <div class="literalblock">
1798 <div class="content">
1799 <pre><tt>commit &lt;sha1&gt;
1800 Author: &lt;author&gt;</tt></pre>
1801 </div></div>
1802 <div class="literalblock">
1803 <div class="content">
1804 <pre><tt>&lt;title line&gt;</tt></pre>
1805 </div></div>
1806 </li>
1807 <li>
1809 <em>medium</em>
1810 </p>
1811 <div class="literalblock">
1812 <div class="content">
1813 <pre><tt>commit &lt;sha1&gt;
1814 Author: &lt;author&gt;
1815 Date: &lt;author date&gt;</tt></pre>
1816 </div></div>
1817 <div class="literalblock">
1818 <div class="content">
1819 <pre><tt>&lt;title line&gt;</tt></pre>
1820 </div></div>
1821 <div class="literalblock">
1822 <div class="content">
1823 <pre><tt>&lt;full commit message&gt;</tt></pre>
1824 </div></div>
1825 </li>
1826 <li>
1828 <em>full</em>
1829 </p>
1830 <div class="literalblock">
1831 <div class="content">
1832 <pre><tt>commit &lt;sha1&gt;
1833 Author: &lt;author&gt;
1834 Commit: &lt;committer&gt;</tt></pre>
1835 </div></div>
1836 <div class="literalblock">
1837 <div class="content">
1838 <pre><tt>&lt;title line&gt;</tt></pre>
1839 </div></div>
1840 <div class="literalblock">
1841 <div class="content">
1842 <pre><tt>&lt;full commit message&gt;</tt></pre>
1843 </div></div>
1844 </li>
1845 <li>
1847 <em>fuller</em>
1848 </p>
1849 <div class="literalblock">
1850 <div class="content">
1851 <pre><tt>commit &lt;sha1&gt;
1852 Author: &lt;author&gt;
1853 AuthorDate: &lt;author date&gt;
1854 Commit: &lt;committer&gt;
1855 CommitDate: &lt;committer date&gt;</tt></pre>
1856 </div></div>
1857 <div class="literalblock">
1858 <div class="content">
1859 <pre><tt>&lt;title line&gt;</tt></pre>
1860 </div></div>
1861 <div class="literalblock">
1862 <div class="content">
1863 <pre><tt>&lt;full commit message&gt;</tt></pre>
1864 </div></div>
1865 </li>
1866 <li>
1868 <em>email</em>
1869 </p>
1870 <div class="literalblock">
1871 <div class="content">
1872 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
1873 From: &lt;author&gt;
1874 Date: &lt;author date&gt;
1875 Subject: [PATCH] &lt;title line&gt;</tt></pre>
1876 </div></div>
1877 <div class="literalblock">
1878 <div class="content">
1879 <pre><tt>&lt;full commit message&gt;</tt></pre>
1880 </div></div>
1881 </li>
1882 <li>
1884 <em>raw</em>
1885 </p>
1886 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
1887 stored in the commit object. Notably, the SHA1s are
1888 displayed in full, regardless of whether --abbrev or
1889 --no-abbrev are used, and <em>parents</em> information show the
1890 true parent commits, without taking grafts nor history
1891 simplification into account.</p></div>
1892 </li>
1893 <li>
1895 <em>format:&lt;string&gt;</em>
1896 </p>
1897 <div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
1898 you want to show. It works a little bit like printf format,
1899 with the notable exception that you get a newline with <em>%n</em>
1900 instead of <em>\n</em>.</p></div>
1901 <div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
1902 would show something like this:</p></div>
1903 <div class="listingblock">
1904 <div class="content">
1905 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1906 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
1907 </div></div>
1908 <div class="paragraph"><p>The placeholders are:</p></div>
1909 <div class="ulist"><ul>
1910 <li>
1912 <em>%H</em>: commit hash
1913 </p>
1914 </li>
1915 <li>
1917 <em>%h</em>: abbreviated commit hash
1918 </p>
1919 </li>
1920 <li>
1922 <em>%T</em>: tree hash
1923 </p>
1924 </li>
1925 <li>
1927 <em>%t</em>: abbreviated tree hash
1928 </p>
1929 </li>
1930 <li>
1932 <em>%P</em>: parent hashes
1933 </p>
1934 </li>
1935 <li>
1937 <em>%p</em>: abbreviated parent hashes
1938 </p>
1939 </li>
1940 <li>
1942 <em>%an</em>: author name
1943 </p>
1944 </li>
1945 <li>
1947 <em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1948 </p>
1949 </li>
1950 <li>
1952 <em>%ae</em>: author email
1953 </p>
1954 </li>
1955 <li>
1957 <em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1958 </p>
1959 </li>
1960 <li>
1962 <em>%ad</em>: author date (format respects --date= option)
1963 </p>
1964 </li>
1965 <li>
1967 <em>%aD</em>: author date, RFC2822 style
1968 </p>
1969 </li>
1970 <li>
1972 <em>%ar</em>: author date, relative
1973 </p>
1974 </li>
1975 <li>
1977 <em>%at</em>: author date, UNIX timestamp
1978 </p>
1979 </li>
1980 <li>
1982 <em>%ai</em>: author date, ISO 8601 format
1983 </p>
1984 </li>
1985 <li>
1987 <em>%cn</em>: committer name
1988 </p>
1989 </li>
1990 <li>
1992 <em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
1993 </p>
1994 </li>
1995 <li>
1997 <em>%ce</em>: committer email
1998 </p>
1999 </li>
2000 <li>
2002 <em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)
2003 </p>
2004 </li>
2005 <li>
2007 <em>%cd</em>: committer date
2008 </p>
2009 </li>
2010 <li>
2012 <em>%cD</em>: committer date, RFC2822 style
2013 </p>
2014 </li>
2015 <li>
2017 <em>%cr</em>: committer date, relative
2018 </p>
2019 </li>
2020 <li>
2022 <em>%ct</em>: committer date, UNIX timestamp
2023 </p>
2024 </li>
2025 <li>
2027 <em>%ci</em>: committer date, ISO 8601 format
2028 </p>
2029 </li>
2030 <li>
2032 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
2033 </p>
2034 </li>
2035 <li>
2037 <em>%e</em>: encoding
2038 </p>
2039 </li>
2040 <li>
2042 <em>%s</em>: subject
2043 </p>
2044 </li>
2045 <li>
2047 <em>%f</em>: sanitized subject line, suitable for a filename
2048 </p>
2049 </li>
2050 <li>
2052 <em>%b</em>: body
2053 </p>
2054 </li>
2055 <li>
2057 <em>%B</em>: raw body (unwrapped subject and body)
2058 </p>
2059 </li>
2060 <li>
2062 <em>%N</em>: commit notes
2063 </p>
2064 </li>
2065 <li>
2067 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
2068 </p>
2069 </li>
2070 <li>
2072 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
2073 </p>
2074 </li>
2075 <li>
2077 <em>%gs</em>: reflog subject
2078 </p>
2079 </li>
2080 <li>
2082 <em>%Cred</em>: switch color to red
2083 </p>
2084 </li>
2085 <li>
2087 <em>%Cgreen</em>: switch color to green
2088 </p>
2089 </li>
2090 <li>
2092 <em>%Cblue</em>: switch color to blue
2093 </p>
2094 </li>
2095 <li>
2097 <em>%Creset</em>: reset color
2098 </p>
2099 </li>
2100 <li>
2102 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
2103 </p>
2104 </li>
2105 <li>
2107 <em>%m</em>: left, right or boundary mark
2108 </p>
2109 </li>
2110 <li>
2112 <em>%n</em>: newline
2113 </p>
2114 </li>
2115 <li>
2117 <em>%%</em>: a raw <em>%</em>
2118 </p>
2119 </li>
2120 <li>
2122 <em>%x00</em>: print a byte from a hex code
2123 </p>
2124 </li>
2125 <li>
2127 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
2128 <a href="git-shortlog.html">git-shortlog(1)</a>.
2129 </p>
2130 </li>
2131 </ul></div>
2132 </li>
2133 </ul></div>
2134 <div class="admonitionblock">
2135 <table><tr>
2136 <td class="icon">
2137 <div class="title">Note</div>
2138 </td>
2139 <td class="content">Some placeholders may depend on other options given to the
2140 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
2141 insert an empty string unless we are traversing reflog entries (e.g., by
2142 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
2143 format if <tt>--decorate</tt> was not already provided on the command line.</td>
2144 </tr></table>
2145 </div>
2146 <div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
2147 is inserted immediately before the expansion if and only if the
2148 placeholder expands to a non-empty string.</p></div>
2149 <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
2150 immediately precede the expansion are deleted if and only if the
2151 placeholder expands to an empty string.</p></div>
2152 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
2153 is inserted immediately before the expansion if and only if the
2154 placeholder expands to a non-empty string.</p></div>
2155 <div class="ulist"><ul>
2156 <li>
2158 <em>tformat:</em>
2159 </p>
2160 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
2161 provides "terminator" semantics instead of "separator" semantics. In
2162 other words, each commit has the message terminator character (usually a
2163 newline) appended, rather than a separator placed between entries.
2164 This means that the final entry of a single-line format will be properly
2165 terminated with a new line, just as the "oneline" format does.
2166 For example:</p></div>
2167 <div class="listingblock">
2168 <div class="content">
2169 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2170 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2171 4da45be
2172 7134973 -- NO NEWLINE
2174 $ git log -2 --pretty=tformat:%h 4da45bef \
2175 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2176 4da45be
2177 7134973</tt></pre>
2178 </div></div>
2179 <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
2180 as if it has <tt>tformat:</tt> in front of it. For example, these two are
2181 equivalent:</p></div>
2182 <div class="listingblock">
2183 <div class="content">
2184 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2185 $ git log -2 --pretty=%h 4da45bef</tt></pre>
2186 </div></div>
2187 </li>
2188 </ul></div>
2189 </div>
2190 <h2 id="_common_diff_options">Common diff options</h2>
2191 <div class="sectionbody">
2192 <div class="dlist"><dl>
2193 <dt class="hdlist1">
2195 </dt>
2196 <dt class="hdlist1">
2198 </dt>
2199 <dt class="hdlist1">
2200 --patch
2201 </dt>
2202 <dd>
2204 Generate patch (see section on generating patches).
2206 </p>
2207 </dd>
2208 <dt class="hdlist1">
2209 -U&lt;n&gt;
2210 </dt>
2211 <dt class="hdlist1">
2212 --unified=&lt;n&gt;
2213 </dt>
2214 <dd>
2216 Generate diffs with &lt;n&gt; lines of context instead of
2217 the usual three.
2218 Implies <tt>-p</tt>.
2219 </p>
2220 </dd>
2221 <dt class="hdlist1">
2222 --raw
2223 </dt>
2224 <dd>
2226 Generate the raw format.
2228 </p>
2229 </dd>
2230 <dt class="hdlist1">
2231 --patch-with-raw
2232 </dt>
2233 <dd>
2235 Synonym for <tt>-p --raw</tt>.
2236 </p>
2237 </dd>
2238 <dt class="hdlist1">
2239 --patience
2240 </dt>
2241 <dd>
2243 Generate a diff using the "patience diff" algorithm.
2244 </p>
2245 </dd>
2246 <dt class="hdlist1">
2247 --stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
2248 </dt>
2249 <dd>
2251 Generate a diffstat. You can override the default
2252 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
2253 The width of the filename part can be controlled by
2254 giving another width to it separated by a comma.
2255 By giving a third parameter <tt>&lt;count&gt;</tt>, you can limit the
2256 output to the first <tt>&lt;count&gt;</tt> lines, followed by
2257 <tt>&#8230;</tt> if there are more.
2258 </p>
2259 <div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=&lt;width&gt;</tt>,
2260 <tt>--stat-name-width=&lt;name-width&gt;</tt> and <tt>--stat-count=&lt;count&gt;</tt>.</p></div>
2261 </dd>
2262 <dt class="hdlist1">
2263 --numstat
2264 </dt>
2265 <dd>
2267 Similar to <tt>--stat</tt>, but shows number of added and
2268 deleted lines in decimal notation and pathname without
2269 abbreviation, to make it more machine friendly. For
2270 binary files, outputs two <tt>-</tt> instead of saying
2271 <tt>0 0</tt>.
2272 </p>
2273 </dd>
2274 <dt class="hdlist1">
2275 --shortstat
2276 </dt>
2277 <dd>
2279 Output only the last line of the <tt>--stat</tt> format containing total
2280 number of modified files, as well as number of added and deleted
2281 lines.
2282 </p>
2283 </dd>
2284 <dt class="hdlist1">
2285 --dirstat[=&lt;param1,param2,&#8230;&gt;]
2286 </dt>
2287 <dd>
2289 Output the distribution of relative amount of changes for each
2290 sub-directory. The behavior of <tt>--dirstat</tt> can be customized by
2291 passing it a comma separated list of parameters.
2292 The defaults are controlled by the <tt>diff.dirstat</tt> configuration
2293 variable (see <a href="git-config.html">git-config(1)</a>).
2294 The following parameters are available:
2295 </p>
2296 <div class="dlist"><dl>
2297 <dt class="hdlist1">
2298 <tt>changes</tt>
2299 </dt>
2300 <dd>
2302 Compute the dirstat numbers by counting the lines that have been
2303 removed from the source, or added to the destination. This ignores
2304 the amount of pure code movements within a file. In other words,
2305 rearranging lines in a file is not counted as much as other changes.
2306 This is the default behavior when no parameter is given.
2307 </p>
2308 </dd>
2309 <dt class="hdlist1">
2310 <tt>lines</tt>
2311 </dt>
2312 <dd>
2314 Compute the dirstat numbers by doing the regular line-based diff
2315 analysis, and summing the removed/added line counts. (For binary
2316 files, count 64-byte chunks instead, since binary files have no
2317 natural concept of lines). This is a more expensive <tt>--dirstat</tt>
2318 behavior than the <tt>changes</tt> behavior, but it does count rearranged
2319 lines within a file as much as other changes. The resulting output
2320 is consistent with what you get from the other <tt>--*stat</tt> options.
2321 </p>
2322 </dd>
2323 <dt class="hdlist1">
2324 <tt>files</tt>
2325 </dt>
2326 <dd>
2328 Compute the dirstat numbers by counting the number of files changed.
2329 Each changed file counts equally in the dirstat analysis. This is
2330 the computationally cheapest <tt>--dirstat</tt> behavior, since it does
2331 not have to look at the file contents at all.
2332 </p>
2333 </dd>
2334 <dt class="hdlist1">
2335 <tt>cumulative</tt>
2336 </dt>
2337 <dd>
2339 Count changes in a child directory for the parent directory as well.
2340 Note that when using <tt>cumulative</tt>, the sum of the percentages
2341 reported may exceed 100%. The default (non-cumulative) behavior can
2342 be specified with the <tt>noncumulative</tt> parameter.
2343 </p>
2344 </dd>
2345 <dt class="hdlist1">
2346 &lt;limit&gt;
2347 </dt>
2348 <dd>
2350 An integer parameter specifies a cut-off percent (3% by default).
2351 Directories contributing less than this percentage of the changes
2352 are not shown in the output.
2353 </p>
2354 </dd>
2355 </dl></div>
2356 <div class="paragraph"><p>Example: The following will count changed files, while ignoring
2357 directories with less than 10% of the total amount of changed files,
2358 and accumulating child directory counts in the parent directories:
2359 <tt>--dirstat=files,10,cumulative</tt>.</p></div>
2360 </dd>
2361 <dt class="hdlist1">
2362 --summary
2363 </dt>
2364 <dd>
2366 Output a condensed summary of extended header information
2367 such as creations, renames and mode changes.
2368 </p>
2369 </dd>
2370 <dt class="hdlist1">
2371 --patch-with-stat
2372 </dt>
2373 <dd>
2375 Synonym for <tt>-p --stat</tt>.
2376 </p>
2377 </dd>
2378 <dt class="hdlist1">
2380 </dt>
2381 <dd>
2383 Separate the commits with NULs instead of with new newlines.
2384 </p>
2385 <div class="paragraph"><p>Also, when <tt>--raw</tt> or <tt>--numstat</tt> has been given, do not munge
2386 pathnames and use NULs as output field terminators.</p></div>
2387 <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
2388 and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
2389 respectively, and the pathname will be enclosed in double quotes if
2390 any of those replacements occurred.</p></div>
2391 </dd>
2392 <dt class="hdlist1">
2393 --name-only
2394 </dt>
2395 <dd>
2397 Show only names of changed files.
2398 </p>
2399 </dd>
2400 <dt class="hdlist1">
2401 --name-status
2402 </dt>
2403 <dd>
2405 Show only names and status of changed files. See the description
2406 of the <tt>--diff-filter</tt> option on what the status letters mean.
2407 </p>
2408 </dd>
2409 <dt class="hdlist1">
2410 --submodule[=&lt;format&gt;]
2411 </dt>
2412 <dd>
2414 Chose the output format for submodule differences. &lt;format&gt; can be one of
2415 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
2416 is used when this option is not given. <em>log</em> is the default value for this
2417 option and lists the commits in that commit range like the <em>summary</em>
2418 option of <a href="git-submodule.html">git-submodule(1)</a> does.
2419 </p>
2420 </dd>
2421 <dt class="hdlist1">
2422 --color[=&lt;when&gt;]
2423 </dt>
2424 <dd>
2426 Show colored diff.
2427 The value must be <tt>always</tt> (the default for <tt>&lt;when&gt;</tt>), <tt>never</tt>, or <tt>auto</tt>.
2428 The default value is <tt>never</tt>.
2429 </p>
2430 </dd>
2431 <dt class="hdlist1">
2432 --no-color
2433 </dt>
2434 <dd>
2436 Turn off colored diff.
2437 It is the same as <tt>--color=never</tt>.
2438 </p>
2439 </dd>
2440 <dt class="hdlist1">
2441 --word-diff[=&lt;mode&gt;]
2442 </dt>
2443 <dd>
2445 Show a word diff, using the &lt;mode&gt; to delimit changed words.
2446 By default, words are delimited by whitespace; see
2447 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
2448 must be one of:
2449 </p>
2450 <div class="dlist"><dl>
2451 <dt class="hdlist1">
2452 color
2453 </dt>
2454 <dd>
2456 Highlight changed words using only colors. Implies <tt>--color</tt>.
2457 </p>
2458 </dd>
2459 <dt class="hdlist1">
2460 plain
2461 </dt>
2462 <dd>
2464 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
2465 attempts to escape the delimiters if they appear in the input,
2466 so the output may be ambiguous.
2467 </p>
2468 </dd>
2469 <dt class="hdlist1">
2470 porcelain
2471 </dt>
2472 <dd>
2474 Use a special line-based format intended for script
2475 consumption. Added/removed/unchanged runs are printed in the
2476 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
2477 character at the beginning of the line and extending to the
2478 end of the line. Newlines in the input are represented by a
2479 tilde <tt>~</tt> on a line of its own.
2480 </p>
2481 </dd>
2482 <dt class="hdlist1">
2483 none
2484 </dt>
2485 <dd>
2487 Disable word diff again.
2488 </p>
2489 </dd>
2490 </dl></div>
2491 <div class="paragraph"><p>Note that despite the name of the first mode, color is used to
2492 highlight the changed parts in all modes if enabled.</p></div>
2493 </dd>
2494 <dt class="hdlist1">
2495 --word-diff-regex=&lt;regex&gt;
2496 </dt>
2497 <dd>
2499 Use &lt;regex&gt; to decide what a word is, instead of considering
2500 runs of non-whitespace to be a word. Also implies
2501 <tt>--word-diff</tt> unless it was already enabled.
2502 </p>
2503 <div class="paragraph"><p>Every non-overlapping match of the
2504 &lt;regex&gt; is considered a word. Anything between these matches is
2505 considered whitespace and ignored(!) for the purposes of finding
2506 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
2507 expression to make sure that it matches all non-whitespace characters.
2508 A match that contains a newline is silently truncated(!) at the
2509 newline.</p></div>
2510 <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
2511 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
2512 overrides any diff driver or configuration setting. Diff drivers
2513 override configuration settings.</p></div>
2514 </dd>
2515 <dt class="hdlist1">
2516 --color-words[=&lt;regex&gt;]
2517 </dt>
2518 <dd>
2520 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
2521 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
2522 </p>
2523 </dd>
2524 <dt class="hdlist1">
2525 --no-renames
2526 </dt>
2527 <dd>
2529 Turn off rename detection, even when the configuration
2530 file gives the default to do so.
2531 </p>
2532 </dd>
2533 <dt class="hdlist1">
2534 --check
2535 </dt>
2536 <dd>
2538 Warn if changes introduce whitespace errors. What are
2539 considered whitespace errors is controlled by <tt>core.whitespace</tt>
2540 configuration. By default, trailing whitespaces (including
2541 lines that solely consist of whitespaces) and a space character
2542 that is immediately followed by a tab character inside the
2543 initial indent of the line are considered whitespace errors.
2544 Exits with non-zero status if problems are found. Not compatible
2545 with --exit-code.
2546 </p>
2547 </dd>
2548 <dt class="hdlist1">
2549 --full-index
2550 </dt>
2551 <dd>
2553 Instead of the first handful of characters, show the full
2554 pre- and post-image blob object names on the "index"
2555 line when generating patch format output.
2556 </p>
2557 </dd>
2558 <dt class="hdlist1">
2559 --binary
2560 </dt>
2561 <dd>
2563 In addition to <tt>--full-index</tt>, output a binary diff that
2564 can be applied with <tt>git-apply</tt>.
2565 </p>
2566 </dd>
2567 <dt class="hdlist1">
2568 --abbrev[=&lt;n&gt;]
2569 </dt>
2570 <dd>
2572 Instead of showing the full 40-byte hexadecimal object
2573 name in diff-raw format output and diff-tree header
2574 lines, show only a partial prefix. This is
2575 independent of the <tt>--full-index</tt> option above, which controls
2576 the diff-patch output format. Non default number of
2577 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
2578 </p>
2579 </dd>
2580 <dt class="hdlist1">
2581 -B[&lt;n&gt;][/&lt;m&gt;]
2582 </dt>
2583 <dt class="hdlist1">
2584 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
2585 </dt>
2586 <dd>
2588 Break complete rewrite changes into pairs of delete and
2589 create. This serves two purposes:
2590 </p>
2591 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
2592 not as a series of deletion and insertion mixed together with a very
2593 few lines that happen to match textually as the context, but as a
2594 single deletion of everything old followed by a single insertion of
2595 everything new, and the number <tt>m</tt> controls this aspect of the -B
2596 option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
2597 original should remain in the result for git to consider it a total
2598 rewrite (i.e. otherwise the resulting patch will be a series of
2599 deletion and insertion mixed together with context lines).</p></div>
2600 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
2601 source of a rename (usually -M only considers a file that disappeared
2602 as the source of a rename), and the number <tt>n</tt> controls this aspect of
2603 the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
2604 addition and deletion compared to 20% or more of the file&#8217;s size are
2605 eligible for being picked up as a possible source of a rename to
2606 another file.</p></div>
2607 </dd>
2608 <dt class="hdlist1">
2609 -M[&lt;n&gt;]
2610 </dt>
2611 <dt class="hdlist1">
2612 --find-renames[=&lt;n&gt;]
2613 </dt>
2614 <dd>
2616 If generating diffs, detect and report renames for each commit.
2617 For following files across renames while traversing history, see
2618 <tt>--follow</tt>.
2619 If <tt>n</tt> is specified, it is a threshold on the similarity
2620 index (i.e. amount of addition/deletions compared to the
2621 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
2622 delete/add pair to be a rename if more than 90% of the file
2623 hasn&#8217;t changed.
2624 </p>
2625 </dd>
2626 <dt class="hdlist1">
2627 -C[&lt;n&gt;]
2628 </dt>
2629 <dt class="hdlist1">
2630 --find-copies[=&lt;n&gt;]
2631 </dt>
2632 <dd>
2634 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
2635 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
2636 </p>
2637 </dd>
2638 <dt class="hdlist1">
2639 --find-copies-harder
2640 </dt>
2641 <dd>
2643 For performance reasons, by default, <tt>-C</tt> option finds copies only
2644 if the original file of the copy was modified in the same
2645 changeset. This flag makes the command
2646 inspect unmodified files as candidates for the source of
2647 copy. This is a very expensive operation for large
2648 projects, so use it with caution. Giving more than one
2649 <tt>-C</tt> option has the same effect.
2650 </p>
2651 </dd>
2652 <dt class="hdlist1">
2654 </dt>
2655 <dt class="hdlist1">
2656 --irreversible-delete
2657 </dt>
2658 <dd>
2660 Omit the preimage for deletes, i.e. print only the header but not
2661 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
2662 is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is
2663 solely for people who want to just concentrate on reviewing the
2664 text after the change. In addition, the output obviously lack
2665 enough information to apply such a patch in reverse, even manually,
2666 hence the name of the option.
2667 </p>
2668 <div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
2669 of a delete/create pair.</p></div>
2670 </dd>
2671 <dt class="hdlist1">
2672 -l&lt;num&gt;
2673 </dt>
2674 <dd>
2676 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
2677 is the number of potential rename/copy targets. This
2678 option prevents rename/copy detection from running if
2679 the number of rename/copy targets exceeds the specified
2680 number.
2681 </p>
2682 </dd>
2683 <dt class="hdlist1">
2684 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
2685 </dt>
2686 <dd>
2688 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
2689 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
2690 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
2691 are Unmerged (<tt>U</tt>), are
2692 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
2693 Any combination of the filter characters (including none) can be used.
2694 When <tt>*</tt> (All-or-none) is added to the combination, all
2695 paths are selected if there is any file that matches
2696 other criteria in the comparison; if there is no file
2697 that matches other criteria, nothing is selected.
2698 </p>
2699 </dd>
2700 <dt class="hdlist1">
2701 -S&lt;string&gt;
2702 </dt>
2703 <dd>
2705 Look for differences that introduce or remove an instance of
2706 &lt;string&gt;. Note that this is different than the string simply
2707 appearing in diff output; see the <em>pickaxe</em> entry in
2708 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
2709 </p>
2710 </dd>
2711 <dt class="hdlist1">
2712 -G&lt;regex&gt;
2713 </dt>
2714 <dd>
2716 Look for differences whose added or removed line matches
2717 the given &lt;regex&gt;.
2718 </p>
2719 </dd>
2720 <dt class="hdlist1">
2721 --pickaxe-all
2722 </dt>
2723 <dd>
2725 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
2726 changeset, not just the files that contain the change
2727 in &lt;string&gt;.
2728 </p>
2729 </dd>
2730 <dt class="hdlist1">
2731 --pickaxe-regex
2732 </dt>
2733 <dd>
2735 Make the &lt;string&gt; not a plain string but an extended POSIX
2736 regex to match.
2737 </p>
2738 </dd>
2739 <dt class="hdlist1">
2740 -O&lt;orderfile&gt;
2741 </dt>
2742 <dd>
2744 Output the patch in the order specified in the
2745 &lt;orderfile&gt;, which has one shell glob pattern per line.
2746 </p>
2747 </dd>
2748 <dt class="hdlist1">
2750 </dt>
2751 <dd>
2753 Swap two inputs; that is, show differences from index or
2754 on-disk file to tree contents.
2755 </p>
2756 </dd>
2757 <dt class="hdlist1">
2758 --relative[=&lt;path&gt;]
2759 </dt>
2760 <dd>
2762 When run from a subdirectory of the project, it can be
2763 told to exclude changes outside the directory and show
2764 pathnames relative to it with this option. When you are
2765 not in a subdirectory (e.g. in a bare repository), you
2766 can name which subdirectory to make the output relative
2767 to by giving a &lt;path&gt; as an argument.
2768 </p>
2769 </dd>
2770 <dt class="hdlist1">
2772 </dt>
2773 <dt class="hdlist1">
2774 --text
2775 </dt>
2776 <dd>
2778 Treat all files as text.
2779 </p>
2780 </dd>
2781 <dt class="hdlist1">
2782 --ignore-space-at-eol
2783 </dt>
2784 <dd>
2786 Ignore changes in whitespace at EOL.
2787 </p>
2788 </dd>
2789 <dt class="hdlist1">
2791 </dt>
2792 <dt class="hdlist1">
2793 --ignore-space-change
2794 </dt>
2795 <dd>
2797 Ignore changes in amount of whitespace. This ignores whitespace
2798 at line end, and considers all other sequences of one or
2799 more whitespace characters to be equivalent.
2800 </p>
2801 </dd>
2802 <dt class="hdlist1">
2804 </dt>
2805 <dt class="hdlist1">
2806 --ignore-all-space
2807 </dt>
2808 <dd>
2810 Ignore whitespace when comparing lines. This ignores
2811 differences even if one line has whitespace where the other
2812 line has none.
2813 </p>
2814 </dd>
2815 <dt class="hdlist1">
2816 --inter-hunk-context=&lt;lines&gt;
2817 </dt>
2818 <dd>
2820 Show the context between diff hunks, up to the specified number
2821 of lines, thereby fusing hunks that are close to each other.
2822 </p>
2823 </dd>
2824 <dt class="hdlist1">
2825 --exit-code
2826 </dt>
2827 <dd>
2829 Make the program exit with codes similar to diff(1).
2830 That is, it exits with 1 if there were differences and
2831 0 means no differences.
2832 </p>
2833 </dd>
2834 <dt class="hdlist1">
2835 --quiet
2836 </dt>
2837 <dd>
2839 Disable all output of the program. Implies <tt>--exit-code</tt>.
2840 </p>
2841 </dd>
2842 <dt class="hdlist1">
2843 --ext-diff
2844 </dt>
2845 <dd>
2847 Allow an external diff helper to be executed. If you set an
2848 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
2849 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
2850 </p>
2851 </dd>
2852 <dt class="hdlist1">
2853 --no-ext-diff
2854 </dt>
2855 <dd>
2857 Disallow external diff drivers.
2858 </p>
2859 </dd>
2860 <dt class="hdlist1">
2861 --textconv
2862 </dt>
2863 <dt class="hdlist1">
2864 --no-textconv
2865 </dt>
2866 <dd>
2868 Allow (or disallow) external text conversion filters to be run
2869 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
2870 details. Because textconv filters are typically a one-way
2871 conversion, the resulting diff is suitable for human
2872 consumption, but cannot be applied. For this reason, textconv
2873 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
2874 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
2875 diff plumbing commands.
2876 </p>
2877 </dd>
2878 <dt class="hdlist1">
2879 --ignore-submodules[=&lt;when&gt;]
2880 </dt>
2881 <dd>
2883 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
2884 either "none", "untracked", "dirty" or "all", which is the default
2885 Using "none" will consider the submodule modified when it either contains
2886 untracked or modified files or its HEAD differs from the commit recorded
2887 in the superproject and can be used to override any settings of the
2888 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
2889 "untracked" is used submodules are not considered dirty when they only
2890 contain untracked content (but they are still scanned for modified
2891 content). Using "dirty" ignores all changes to the work tree of submodules,
2892 only changes to the commits stored in the superproject are shown (this was
2893 the behavior until 1.7.0). Using "all" hides all changes to submodules.
2894 </p>
2895 </dd>
2896 <dt class="hdlist1">
2897 --src-prefix=&lt;prefix&gt;
2898 </dt>
2899 <dd>
2901 Show the given source prefix instead of "a/".
2902 </p>
2903 </dd>
2904 <dt class="hdlist1">
2905 --dst-prefix=&lt;prefix&gt;
2906 </dt>
2907 <dd>
2909 Show the given destination prefix instead of "b/".
2910 </p>
2911 </dd>
2912 <dt class="hdlist1">
2913 --no-prefix
2914 </dt>
2915 <dd>
2917 Do not show any source or destination prefix.
2918 </p>
2919 </dd>
2920 </dl></div>
2921 <div class="paragraph"><p>For more detailed explanation on these common options, see also
2922 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
2923 </div>
2924 <h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2925 <div class="sectionbody">
2926 <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2927 with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2928 "git log" with the "-p" option, they
2929 do not produce the output described above; instead they produce a
2930 patch file. You can customize the creation of such patches via the
2931 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2932 <div class="paragraph"><p>What the -p option produces is slightly different from the traditional
2933 diff format:</p></div>
2934 <div class="olist arabic"><ol class="arabic">
2935 <li>
2937 It is preceded with a "git diff" header that looks like this:
2938 </p>
2939 <div class="literalblock">
2940 <div class="content">
2941 <pre><tt>diff --git a/file1 b/file2</tt></pre>
2942 </div></div>
2943 <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
2944 involved. Especially, even for a creation or a deletion,
2945 <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2946 <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
2947 name of the source file of the rename/copy and the name of
2948 the file that rename/copy produces, respectively.</p></div>
2949 </li>
2950 <li>
2952 It is followed by one or more extended header lines:
2953 </p>
2954 <div class="literalblock">
2955 <div class="content">
2956 <pre><tt>old mode &lt;mode&gt;
2957 new mode &lt;mode&gt;
2958 deleted file mode &lt;mode&gt;
2959 new file mode &lt;mode&gt;
2960 copy from &lt;path&gt;
2961 copy to &lt;path&gt;
2962 rename from &lt;path&gt;
2963 rename to &lt;path&gt;
2964 similarity index &lt;number&gt;
2965 dissimilarity index &lt;number&gt;
2966 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2967 </div></div>
2968 <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
2969 and file permission bits.</p></div>
2970 <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
2971 <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
2972 the dissimilarity index is the percentage of changed lines. It
2973 is a rounded down integer, followed by a percent sign. The
2974 similarity index value of 100% is thus reserved for two equal
2975 files, while 100% dissimilarity means that no line from the old
2976 file made it into the new one.</p></div>
2977 <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
2978 The &lt;mode&gt; is included if the file mode does not change; otherwise,
2979 separate lines indicate the old and the new mode.</p></div>
2980 </li>
2981 <li>
2983 TAB, LF, double quote and backslash characters in pathnames
2984 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2985 If there is need for such substitution then the whole
2986 pathname is put in double quotes.
2987 </p>
2988 </li>
2989 <li>
2991 All the <tt>file1</tt> files in the output refer to files before the
2992 commit, and all the <tt>file2</tt> files refer to files after the commit.
2993 It is incorrect to apply each change to each file sequentially. For
2994 example, this patch will swap a and b:
2995 </p>
2996 <div class="literalblock">
2997 <div class="content">
2998 <pre><tt>diff --git a/a b/b
2999 rename from a
3000 rename to b
3001 diff --git a/b b/a
3002 rename from b
3003 rename to a</tt></pre>
3004 </div></div>
3005 </li>
3006 </ol></div>
3007 </div>
3008 <h2 id="_combined_diff_format">combined diff format</h2>
3009 <div class="sectionbody">
3010 <div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
3011 produce a <em>combined diff</em> when showing a merge. This is the default
3012 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
3013 <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
3014 of these commands to force generation of diffs with individual parents
3015 of a merge.</p></div>
3016 <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
3017 <div class="listingblock">
3018 <div class="content">
3019 <pre><tt>diff --combined describe.c
3020 index fabadb8,cc95eb0..4866510
3021 --- a/describe.c
3022 +++ b/describe.c
3023 @@@ -98,20 -98,12 +98,20 @@@
3024 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
3027 - static void describe(char *arg)
3028 -static void describe(struct commit *cmit, int last_one)
3029 ++static void describe(char *arg, int last_one)
3031 + unsigned char sha1[20];
3032 + struct commit *cmit;
3033 struct commit_list *list;
3034 static int initialized = 0;
3035 struct commit_name *n;
3037 + if (get_sha1(arg, sha1) &lt; 0)
3038 + usage(describe_usage);
3039 + cmit = lookup_commit_reference(sha1);
3040 + if (!cmit)
3041 + usage(describe_usage);
3043 if (!initialized) {
3044 initialized = 1;
3045 for_each_ref(get_name);</tt></pre>
3046 </div></div>
3047 <div class="olist arabic"><ol class="arabic">
3048 <li>
3050 It is preceded with a "git diff" header, that looks like
3051 this (when <em>-c</em> option is used):
3052 </p>
3053 <div class="literalblock">
3054 <div class="content">
3055 <pre><tt>diff --combined file</tt></pre>
3056 </div></div>
3057 <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
3058 <div class="literalblock">
3059 <div class="content">
3060 <pre><tt>diff --cc file</tt></pre>
3061 </div></div>
3062 </li>
3063 <li>
3065 It is followed by one or more extended header lines
3066 (this example shows a merge with two parents):
3067 </p>
3068 <div class="literalblock">
3069 <div class="content">
3070 <pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
3071 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
3072 new file mode &lt;mode&gt;
3073 deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
3074 </div></div>
3075 <div class="paragraph"><p>The <tt>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</tt> line appears only if at least one of
3076 the &lt;mode&gt; is different from the rest. Extended headers with
3077 information about detected contents movement (renames and
3078 copying detection) are designed to work with diff of two
3079 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
3080 </li>
3081 <li>
3083 It is followed by two-line from-file/to-file header
3084 </p>
3085 <div class="literalblock">
3086 <div class="content">
3087 <pre><tt>--- a/file
3088 +++ b/file</tt></pre>
3089 </div></div>
3090 <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
3091 format, <tt>/dev/null</tt> is used to signal created or deleted
3092 files.</p></div>
3093 </li>
3094 <li>
3096 Chunk header format is modified to prevent people from
3097 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
3098 was created for review of merge commit changes, and was not
3099 meant for apply. The change is similar to the change in the
3100 extended <em>index</em> header:
3101 </p>
3102 <div class="literalblock">
3103 <div class="content">
3104 <pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
3105 </div></div>
3106 <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
3107 header for combined diff format.</p></div>
3108 </li>
3109 </ol></div>
3110 <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
3111 files A and B with a single column that has <tt>-</tt> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <tt>+</tt> (plus&#8201;&#8212;&#8201;missing in A but
3112 added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
3113 compares two or more files file1, file2,&#8230; with one file X, and
3114 shows how X differs from each of fileN. One column for each of
3115 fileN is prepended to the output line to note how X&#8217;s line is
3116 different from it.</p></div>
3117 <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
3118 fileN but it does not appear in the result. A <tt>+</tt> character
3119 in the column N means that the line appears in the result,
3120 and fileN does not have that line (in other words, the line was
3121 added, from the point of view of that parent).</p></div>
3122 <div class="paragraph"><p>In the above example output, the function signature was changed
3123 from both files (hence two <tt>-</tt> removals from both file1 and
3124 file2, plus <tt>++</tt> to mean one line that was added does not appear
3125 in either file1 nor file2). Also eight other lines are the same
3126 from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
3127 <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
3128 merge commit with the merge result (i.e. file1..fileN are the
3129 parents). When shown by <tt>git diff-files -c</tt>, it compares the
3130 two unresolved merge parents with the working tree file
3131 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
3132 "their version").</p></div>
3133 </div>
3134 <h2 id="_examples">Examples</h2>
3135 <div class="sectionbody">
3136 <div class="dlist"><dl>
3137 <dt class="hdlist1">
3138 <tt>git log --no-merges</tt>
3139 </dt>
3140 <dd>
3142 Show the whole commit history, but skip any merges
3143 </p>
3144 </dd>
3145 <dt class="hdlist1">
3146 <tt>git log v2.6.12.. include/scsi drivers/scsi</tt>
3147 </dt>
3148 <dd>
3150 Show all commits since version <em>v2.6.12</em> that changed any file
3151 in the include/scsi or drivers/scsi subdirectories
3152 </p>
3153 </dd>
3154 <dt class="hdlist1">
3155 <tt>git log --since="2 weeks ago" -- gitk</tt>
3156 </dt>
3157 <dd>
3159 Show the changes during the last two weeks to the file <em>gitk</em>.
3160 The "--" is necessary to avoid confusion with the <strong>branch</strong> named
3161 <em>gitk</em>
3162 </p>
3163 </dd>
3164 <dt class="hdlist1">
3165 <tt>git log --name-status release..test</tt>
3166 </dt>
3167 <dd>
3169 Show the commits that are in the "test" branch but not yet
3170 in the "release" branch, along with the list of paths
3171 each commit modifies.
3172 </p>
3173 </dd>
3174 <dt class="hdlist1">
3175 <tt>git log --follow builtin-rev-list.c</tt>
3176 </dt>
3177 <dd>
3179 Shows the commits that changed builtin-rev-list.c, including
3180 those commits that occurred before the file was given its
3181 present name.
3182 </p>
3183 </dd>
3184 <dt class="hdlist1">
3185 <tt>git log --branches --not --remotes=origin</tt>
3186 </dt>
3187 <dd>
3189 Shows all commits that are in any of local branches but not in
3190 any of remote-tracking branches for <em>origin</em> (what you have that
3191 origin doesn&#8217;t).
3192 </p>
3193 </dd>
3194 <dt class="hdlist1">
3195 <tt>git log master --not --remotes=*/master</tt>
3196 </dt>
3197 <dd>
3199 Shows all commits that are in local master but not in any remote
3200 repository master branches.
3201 </p>
3202 </dd>
3203 <dt class="hdlist1">
3204 <tt>git log -p -m --first-parent</tt>
3205 </dt>
3206 <dd>
3208 Shows the history including change diffs, but only from the
3209 "main branch" perspective, skipping commits that come from merged
3210 branches, and showing full diffs of changes introduced by the merges.
3211 This makes sense only when following a strict policy of merging all
3212 topic branches when staying on a single integration branch.
3213 </p>
3214 </dd>
3215 </dl></div>
3216 </div>
3217 <h2 id="_discussion">Discussion</h2>
3218 <div class="sectionbody">
3219 <div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div>
3220 <div class="ulist"><ul>
3221 <li>
3223 The pathnames recorded in the index and in the tree objects
3224 are treated as uninterpreted sequences of non-NUL bytes.
3225 What readdir(2) returns are what are recorded and compared
3226 with the data git keeps track of, which in turn are expected
3227 to be what lstat(2) and creat(2) accepts. There is no such
3228 thing as pathname encoding translation.
3229 </p>
3230 </li>
3231 <li>
3233 The contents of the blob objects are uninterpreted sequences
3234 of bytes. There is no encoding translation at the core
3235 level.
3236 </p>
3237 </li>
3238 <li>
3240 The commit log messages are uninterpreted sequences of non-NUL
3241 bytes.
3242 </p>
3243 </li>
3244 </ul></div>
3245 <div class="paragraph"><p>Although we encourage that the commit log messages are encoded
3246 in UTF-8, both the core and git Porcelain are designed not to
3247 force UTF-8 on projects. If all participants of a particular
3248 project find it more convenient to use legacy encodings, git
3249 does not forbid it. However, there are a few things to keep in
3250 mind.</p></div>
3251 <div class="olist arabic"><ol class="arabic">
3252 <li>
3254 <em>git commit</em> and <em>git commit-tree</em> issues
3255 a warning if the commit log message given to it does not look
3256 like a valid UTF-8 string, unless you explicitly say your
3257 project uses a legacy encoding. The way to say this is to
3258 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
3259 </p>
3260 <div class="listingblock">
3261 <div class="content">
3262 <pre><tt>[i18n]
3263 commitencoding = ISO-8859-1</tt></pre>
3264 </div></div>
3265 <div class="paragraph"><p>Commit objects created with the above setting record the value
3266 of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
3267 help other people who look at them later. Lack of this header
3268 implies that the commit log message is encoded in UTF-8.</p></div>
3269 </li>
3270 <li>
3272 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
3273 <tt>encoding</tt> header of a commit object, and try to re-code the
3274 log message into UTF-8 unless otherwise specified. You can
3275 specify the desired output encoding with
3276 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
3277 </p>
3278 <div class="listingblock">
3279 <div class="content">
3280 <pre><tt>[i18n]
3281 logoutputencoding = ISO-8859-1</tt></pre>
3282 </div></div>
3283 <div class="paragraph"><p>If you do not have this configuration variable, the value of
3284 <tt>i18n.commitencoding</tt> is used instead.</p></div>
3285 </li>
3286 </ol></div>
3287 <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
3288 message when a commit is made to force UTF-8 at the commit
3289 object level, because re-coding to UTF-8 is not necessarily a
3290 reversible operation.</p></div>
3291 </div>
3292 <h2 id="_configuration">Configuration</h2>
3293 <div class="sectionbody">
3294 <div class="paragraph"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a>
3295 for settings related to diff generation.</p></div>
3296 <div class="dlist"><dl>
3297 <dt class="hdlist1">
3298 format.pretty
3299 </dt>
3300 <dd>
3302 Default for the <tt>--format</tt> option. (See "PRETTY FORMATS" above.)
3303 Defaults to "medium".
3304 </p>
3305 </dd>
3306 <dt class="hdlist1">
3307 i18n.logOutputEncoding
3308 </dt>
3309 <dd>
3311 Encoding to use when displaying logs. (See "Discussion", above.)
3312 Defaults to the value of <tt>i18n.commitEncoding</tt> if set, UTF-8
3313 otherwise.
3314 </p>
3315 </dd>
3316 <dt class="hdlist1">
3317 log.date
3318 </dt>
3319 <dd>
3321 Default format for human-readable dates. (Compare the
3322 <tt>--date</tt> option.) Defaults to "default", which means to write
3323 dates like <tt>Sat May 8 19:35:34 2010 -0500</tt>.
3324 </p>
3325 </dd>
3326 <dt class="hdlist1">
3327 log.showroot
3328 </dt>
3329 <dd>
3331 If <tt>false</tt>, <em>git log</em> and related commands will not treat the
3332 initial commit as a big creation event. Any root commits in
3333 <tt>git log -p</tt> output would be shown without a diff attached.
3334 The default is <tt>true</tt>.
3335 </p>
3336 </dd>
3337 <dt class="hdlist1">
3338 mailmap.file
3339 </dt>
3340 <dd>
3342 See <a href="git-shortlog.html">git-shortlog(1)</a>.
3343 </p>
3344 </dd>
3345 <dt class="hdlist1">
3346 notes.displayRef
3347 </dt>
3348 <dd>
3350 Which refs, in addition to the default set by <tt>core.notesRef</tt>
3351 or <em>GIT_NOTES_REF</em>, to read notes from when showing commit
3352 messages with the <em>log</em> family of commands. See
3353 <a href="git-notes.html">git-notes(1)</a>.
3354 </p>
3355 <div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
3356 multiple times. A warning will be issued for refs that do not exist,
3357 but a glob that does not match any refs is silently ignored.</p></div>
3358 <div class="paragraph"><p>This setting can be disabled by the <tt>--no-notes</tt> option,
3359 overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable,
3360 and overridden by the <tt>--notes=&lt;ref&gt;</tt> option.</p></div>
3361 </dd>
3362 </dl></div>
3363 </div>
3364 <h2 id="_git">GIT</h2>
3365 <div class="sectionbody">
3366 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
3367 </div>
3368 </div>
3369 <div id="footnotes"><hr /></div>
3370 <div id="footer">
3371 <div id="footer-text">
3372 Last updated 2011-09-21 23:01:14 PDT
3373 </div>
3374 </div>
3375 </body>
3376 </html>