Autogenerated HTML docs for v1.7.7-290-gc9e7aa
[git/jnareb-git.git] / git-log.html
blob94c1b0714908d6179d3305f76f85a6732eb2b8e8
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 --minimal
2240 </dt>
2241 <dd>
2243 Spend extra time to make sure the smallest possible
2244 diff is produced.
2245 </p>
2246 </dd>
2247 <dt class="hdlist1">
2248 --patience
2249 </dt>
2250 <dd>
2252 Generate a diff using the "patience diff" algorithm.
2253 </p>
2254 </dd>
2255 <dt class="hdlist1">
2256 --stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
2257 </dt>
2258 <dd>
2260 Generate a diffstat. You can override the default
2261 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
2262 The width of the filename part can be controlled by
2263 giving another width to it separated by a comma.
2264 By giving a third parameter <tt>&lt;count&gt;</tt>, you can limit the
2265 output to the first <tt>&lt;count&gt;</tt> lines, followed by
2266 <tt>&#8230;</tt> if there are more.
2267 </p>
2268 <div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=&lt;width&gt;</tt>,
2269 <tt>--stat-name-width=&lt;name-width&gt;</tt> and <tt>--stat-count=&lt;count&gt;</tt>.</p></div>
2270 </dd>
2271 <dt class="hdlist1">
2272 --numstat
2273 </dt>
2274 <dd>
2276 Similar to <tt>--stat</tt>, but shows number of added and
2277 deleted lines in decimal notation and pathname without
2278 abbreviation, to make it more machine friendly. For
2279 binary files, outputs two <tt>-</tt> instead of saying
2280 <tt>0 0</tt>.
2281 </p>
2282 </dd>
2283 <dt class="hdlist1">
2284 --shortstat
2285 </dt>
2286 <dd>
2288 Output only the last line of the <tt>--stat</tt> format containing total
2289 number of modified files, as well as number of added and deleted
2290 lines.
2291 </p>
2292 </dd>
2293 <dt class="hdlist1">
2294 --dirstat[=&lt;param1,param2,&#8230;&gt;]
2295 </dt>
2296 <dd>
2298 Output the distribution of relative amount of changes for each
2299 sub-directory. The behavior of <tt>--dirstat</tt> can be customized by
2300 passing it a comma separated list of parameters.
2301 The defaults are controlled by the <tt>diff.dirstat</tt> configuration
2302 variable (see <a href="git-config.html">git-config(1)</a>).
2303 The following parameters are available:
2304 </p>
2305 <div class="dlist"><dl>
2306 <dt class="hdlist1">
2307 <tt>changes</tt>
2308 </dt>
2309 <dd>
2311 Compute the dirstat numbers by counting the lines that have been
2312 removed from the source, or added to the destination. This ignores
2313 the amount of pure code movements within a file. In other words,
2314 rearranging lines in a file is not counted as much as other changes.
2315 This is the default behavior when no parameter is given.
2316 </p>
2317 </dd>
2318 <dt class="hdlist1">
2319 <tt>lines</tt>
2320 </dt>
2321 <dd>
2323 Compute the dirstat numbers by doing the regular line-based diff
2324 analysis, and summing the removed/added line counts. (For binary
2325 files, count 64-byte chunks instead, since binary files have no
2326 natural concept of lines). This is a more expensive <tt>--dirstat</tt>
2327 behavior than the <tt>changes</tt> behavior, but it does count rearranged
2328 lines within a file as much as other changes. The resulting output
2329 is consistent with what you get from the other <tt>--*stat</tt> options.
2330 </p>
2331 </dd>
2332 <dt class="hdlist1">
2333 <tt>files</tt>
2334 </dt>
2335 <dd>
2337 Compute the dirstat numbers by counting the number of files changed.
2338 Each changed file counts equally in the dirstat analysis. This is
2339 the computationally cheapest <tt>--dirstat</tt> behavior, since it does
2340 not have to look at the file contents at all.
2341 </p>
2342 </dd>
2343 <dt class="hdlist1">
2344 <tt>cumulative</tt>
2345 </dt>
2346 <dd>
2348 Count changes in a child directory for the parent directory as well.
2349 Note that when using <tt>cumulative</tt>, the sum of the percentages
2350 reported may exceed 100%. The default (non-cumulative) behavior can
2351 be specified with the <tt>noncumulative</tt> parameter.
2352 </p>
2353 </dd>
2354 <dt class="hdlist1">
2355 &lt;limit&gt;
2356 </dt>
2357 <dd>
2359 An integer parameter specifies a cut-off percent (3% by default).
2360 Directories contributing less than this percentage of the changes
2361 are not shown in the output.
2362 </p>
2363 </dd>
2364 </dl></div>
2365 <div class="paragraph"><p>Example: The following will count changed files, while ignoring
2366 directories with less than 10% of the total amount of changed files,
2367 and accumulating child directory counts in the parent directories:
2368 <tt>--dirstat=files,10,cumulative</tt>.</p></div>
2369 </dd>
2370 <dt class="hdlist1">
2371 --summary
2372 </dt>
2373 <dd>
2375 Output a condensed summary of extended header information
2376 such as creations, renames and mode changes.
2377 </p>
2378 </dd>
2379 <dt class="hdlist1">
2380 --patch-with-stat
2381 </dt>
2382 <dd>
2384 Synonym for <tt>-p --stat</tt>.
2385 </p>
2386 </dd>
2387 <dt class="hdlist1">
2389 </dt>
2390 <dd>
2392 Separate the commits with NULs instead of with new newlines.
2393 </p>
2394 <div class="paragraph"><p>Also, when <tt>--raw</tt> or <tt>--numstat</tt> has been given, do not munge
2395 pathnames and use NULs as output field terminators.</p></div>
2396 <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
2397 and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
2398 respectively, and the pathname will be enclosed in double quotes if
2399 any of those replacements occurred.</p></div>
2400 </dd>
2401 <dt class="hdlist1">
2402 --name-only
2403 </dt>
2404 <dd>
2406 Show only names of changed files.
2407 </p>
2408 </dd>
2409 <dt class="hdlist1">
2410 --name-status
2411 </dt>
2412 <dd>
2414 Show only names and status of changed files. See the description
2415 of the <tt>--diff-filter</tt> option on what the status letters mean.
2416 </p>
2417 </dd>
2418 <dt class="hdlist1">
2419 --submodule[=&lt;format&gt;]
2420 </dt>
2421 <dd>
2423 Chose the output format for submodule differences. &lt;format&gt; can be one of
2424 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
2425 is used when this option is not given. <em>log</em> is the default value for this
2426 option and lists the commits in that commit range like the <em>summary</em>
2427 option of <a href="git-submodule.html">git-submodule(1)</a> does.
2428 </p>
2429 </dd>
2430 <dt class="hdlist1">
2431 --color[=&lt;when&gt;]
2432 </dt>
2433 <dd>
2435 Show colored diff.
2436 The value must be <tt>always</tt> (the default for <tt>&lt;when&gt;</tt>), <tt>never</tt>, or <tt>auto</tt>.
2437 The default value is <tt>never</tt>.
2438 </p>
2439 </dd>
2440 <dt class="hdlist1">
2441 --no-color
2442 </dt>
2443 <dd>
2445 Turn off colored diff.
2446 It is the same as <tt>--color=never</tt>.
2447 </p>
2448 </dd>
2449 <dt class="hdlist1">
2450 --word-diff[=&lt;mode&gt;]
2451 </dt>
2452 <dd>
2454 Show a word diff, using the &lt;mode&gt; to delimit changed words.
2455 By default, words are delimited by whitespace; see
2456 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
2457 must be one of:
2458 </p>
2459 <div class="dlist"><dl>
2460 <dt class="hdlist1">
2461 color
2462 </dt>
2463 <dd>
2465 Highlight changed words using only colors. Implies <tt>--color</tt>.
2466 </p>
2467 </dd>
2468 <dt class="hdlist1">
2469 plain
2470 </dt>
2471 <dd>
2473 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
2474 attempts to escape the delimiters if they appear in the input,
2475 so the output may be ambiguous.
2476 </p>
2477 </dd>
2478 <dt class="hdlist1">
2479 porcelain
2480 </dt>
2481 <dd>
2483 Use a special line-based format intended for script
2484 consumption. Added/removed/unchanged runs are printed in the
2485 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
2486 character at the beginning of the line and extending to the
2487 end of the line. Newlines in the input are represented by a
2488 tilde <tt>~</tt> on a line of its own.
2489 </p>
2490 </dd>
2491 <dt class="hdlist1">
2492 none
2493 </dt>
2494 <dd>
2496 Disable word diff again.
2497 </p>
2498 </dd>
2499 </dl></div>
2500 <div class="paragraph"><p>Note that despite the name of the first mode, color is used to
2501 highlight the changed parts in all modes if enabled.</p></div>
2502 </dd>
2503 <dt class="hdlist1">
2504 --word-diff-regex=&lt;regex&gt;
2505 </dt>
2506 <dd>
2508 Use &lt;regex&gt; to decide what a word is, instead of considering
2509 runs of non-whitespace to be a word. Also implies
2510 <tt>--word-diff</tt> unless it was already enabled.
2511 </p>
2512 <div class="paragraph"><p>Every non-overlapping match of the
2513 &lt;regex&gt; is considered a word. Anything between these matches is
2514 considered whitespace and ignored(!) for the purposes of finding
2515 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
2516 expression to make sure that it matches all non-whitespace characters.
2517 A match that contains a newline is silently truncated(!) at the
2518 newline.</p></div>
2519 <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
2520 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
2521 overrides any diff driver or configuration setting. Diff drivers
2522 override configuration settings.</p></div>
2523 </dd>
2524 <dt class="hdlist1">
2525 --color-words[=&lt;regex&gt;]
2526 </dt>
2527 <dd>
2529 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
2530 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
2531 </p>
2532 </dd>
2533 <dt class="hdlist1">
2534 --no-renames
2535 </dt>
2536 <dd>
2538 Turn off rename detection, even when the configuration
2539 file gives the default to do so.
2540 </p>
2541 </dd>
2542 <dt class="hdlist1">
2543 --check
2544 </dt>
2545 <dd>
2547 Warn if changes introduce whitespace errors. What are
2548 considered whitespace errors is controlled by <tt>core.whitespace</tt>
2549 configuration. By default, trailing whitespaces (including
2550 lines that solely consist of whitespaces) and a space character
2551 that is immediately followed by a tab character inside the
2552 initial indent of the line are considered whitespace errors.
2553 Exits with non-zero status if problems are found. Not compatible
2554 with --exit-code.
2555 </p>
2556 </dd>
2557 <dt class="hdlist1">
2558 --full-index
2559 </dt>
2560 <dd>
2562 Instead of the first handful of characters, show the full
2563 pre- and post-image blob object names on the "index"
2564 line when generating patch format output.
2565 </p>
2566 </dd>
2567 <dt class="hdlist1">
2568 --binary
2569 </dt>
2570 <dd>
2572 In addition to <tt>--full-index</tt>, output a binary diff that
2573 can be applied with <tt>git-apply</tt>.
2574 </p>
2575 </dd>
2576 <dt class="hdlist1">
2577 --abbrev[=&lt;n&gt;]
2578 </dt>
2579 <dd>
2581 Instead of showing the full 40-byte hexadecimal object
2582 name in diff-raw format output and diff-tree header
2583 lines, show only a partial prefix. This is
2584 independent of the <tt>--full-index</tt> option above, which controls
2585 the diff-patch output format. Non default number of
2586 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
2587 </p>
2588 </dd>
2589 <dt class="hdlist1">
2590 -B[&lt;n&gt;][/&lt;m&gt;]
2591 </dt>
2592 <dt class="hdlist1">
2593 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
2594 </dt>
2595 <dd>
2597 Break complete rewrite changes into pairs of delete and
2598 create. This serves two purposes:
2599 </p>
2600 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
2601 not as a series of deletion and insertion mixed together with a very
2602 few lines that happen to match textually as the context, but as a
2603 single deletion of everything old followed by a single insertion of
2604 everything new, and the number <tt>m</tt> controls this aspect of the -B
2605 option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
2606 original should remain in the result for git to consider it a total
2607 rewrite (i.e. otherwise the resulting patch will be a series of
2608 deletion and insertion mixed together with context lines).</p></div>
2609 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
2610 source of a rename (usually -M only considers a file that disappeared
2611 as the source of a rename), and the number <tt>n</tt> controls this aspect of
2612 the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
2613 addition and deletion compared to 20% or more of the file&#8217;s size are
2614 eligible for being picked up as a possible source of a rename to
2615 another file.</p></div>
2616 </dd>
2617 <dt class="hdlist1">
2618 -M[&lt;n&gt;]
2619 </dt>
2620 <dt class="hdlist1">
2621 --find-renames[=&lt;n&gt;]
2622 </dt>
2623 <dd>
2625 If generating diffs, detect and report renames for each commit.
2626 For following files across renames while traversing history, see
2627 <tt>--follow</tt>.
2628 If <tt>n</tt> is specified, it is a threshold on the similarity
2629 index (i.e. amount of addition/deletions compared to the
2630 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
2631 delete/add pair to be a rename if more than 90% of the file
2632 hasn&#8217;t changed.
2633 </p>
2634 </dd>
2635 <dt class="hdlist1">
2636 -C[&lt;n&gt;]
2637 </dt>
2638 <dt class="hdlist1">
2639 --find-copies[=&lt;n&gt;]
2640 </dt>
2641 <dd>
2643 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
2644 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
2645 </p>
2646 </dd>
2647 <dt class="hdlist1">
2648 --find-copies-harder
2649 </dt>
2650 <dd>
2652 For performance reasons, by default, <tt>-C</tt> option finds copies only
2653 if the original file of the copy was modified in the same
2654 changeset. This flag makes the command
2655 inspect unmodified files as candidates for the source of
2656 copy. This is a very expensive operation for large
2657 projects, so use it with caution. Giving more than one
2658 <tt>-C</tt> option has the same effect.
2659 </p>
2660 </dd>
2661 <dt class="hdlist1">
2663 </dt>
2664 <dt class="hdlist1">
2665 --irreversible-delete
2666 </dt>
2667 <dd>
2669 Omit the preimage for deletes, i.e. print only the header but not
2670 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
2671 is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is
2672 solely for people who want to just concentrate on reviewing the
2673 text after the change. In addition, the output obviously lack
2674 enough information to apply such a patch in reverse, even manually,
2675 hence the name of the option.
2676 </p>
2677 <div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
2678 of a delete/create pair.</p></div>
2679 </dd>
2680 <dt class="hdlist1">
2681 -l&lt;num&gt;
2682 </dt>
2683 <dd>
2685 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
2686 is the number of potential rename/copy targets. This
2687 option prevents rename/copy detection from running if
2688 the number of rename/copy targets exceeds the specified
2689 number.
2690 </p>
2691 </dd>
2692 <dt class="hdlist1">
2693 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
2694 </dt>
2695 <dd>
2697 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
2698 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
2699 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
2700 are Unmerged (<tt>U</tt>), are
2701 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
2702 Any combination of the filter characters (including none) can be used.
2703 When <tt>*</tt> (All-or-none) is added to the combination, all
2704 paths are selected if there is any file that matches
2705 other criteria in the comparison; if there is no file
2706 that matches other criteria, nothing is selected.
2707 </p>
2708 </dd>
2709 <dt class="hdlist1">
2710 -S&lt;string&gt;
2711 </dt>
2712 <dd>
2714 Look for differences that introduce or remove an instance of
2715 &lt;string&gt;. Note that this is different than the string simply
2716 appearing in diff output; see the <em>pickaxe</em> entry in
2717 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
2718 </p>
2719 </dd>
2720 <dt class="hdlist1">
2721 -G&lt;regex&gt;
2722 </dt>
2723 <dd>
2725 Look for differences whose added or removed line matches
2726 the given &lt;regex&gt;.
2727 </p>
2728 </dd>
2729 <dt class="hdlist1">
2730 --pickaxe-all
2731 </dt>
2732 <dd>
2734 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
2735 changeset, not just the files that contain the change
2736 in &lt;string&gt;.
2737 </p>
2738 </dd>
2739 <dt class="hdlist1">
2740 --pickaxe-regex
2741 </dt>
2742 <dd>
2744 Make the &lt;string&gt; not a plain string but an extended POSIX
2745 regex to match.
2746 </p>
2747 </dd>
2748 <dt class="hdlist1">
2749 -O&lt;orderfile&gt;
2750 </dt>
2751 <dd>
2753 Output the patch in the order specified in the
2754 &lt;orderfile&gt;, which has one shell glob pattern per line.
2755 </p>
2756 </dd>
2757 <dt class="hdlist1">
2759 </dt>
2760 <dd>
2762 Swap two inputs; that is, show differences from index or
2763 on-disk file to tree contents.
2764 </p>
2765 </dd>
2766 <dt class="hdlist1">
2767 --relative[=&lt;path&gt;]
2768 </dt>
2769 <dd>
2771 When run from a subdirectory of the project, it can be
2772 told to exclude changes outside the directory and show
2773 pathnames relative to it with this option. When you are
2774 not in a subdirectory (e.g. in a bare repository), you
2775 can name which subdirectory to make the output relative
2776 to by giving a &lt;path&gt; as an argument.
2777 </p>
2778 </dd>
2779 <dt class="hdlist1">
2781 </dt>
2782 <dt class="hdlist1">
2783 --text
2784 </dt>
2785 <dd>
2787 Treat all files as text.
2788 </p>
2789 </dd>
2790 <dt class="hdlist1">
2791 --ignore-space-at-eol
2792 </dt>
2793 <dd>
2795 Ignore changes in whitespace at EOL.
2796 </p>
2797 </dd>
2798 <dt class="hdlist1">
2800 </dt>
2801 <dt class="hdlist1">
2802 --ignore-space-change
2803 </dt>
2804 <dd>
2806 Ignore changes in amount of whitespace. This ignores whitespace
2807 at line end, and considers all other sequences of one or
2808 more whitespace characters to be equivalent.
2809 </p>
2810 </dd>
2811 <dt class="hdlist1">
2813 </dt>
2814 <dt class="hdlist1">
2815 --ignore-all-space
2816 </dt>
2817 <dd>
2819 Ignore whitespace when comparing lines. This ignores
2820 differences even if one line has whitespace where the other
2821 line has none.
2822 </p>
2823 </dd>
2824 <dt class="hdlist1">
2825 --inter-hunk-context=&lt;lines&gt;
2826 </dt>
2827 <dd>
2829 Show the context between diff hunks, up to the specified number
2830 of lines, thereby fusing hunks that are close to each other.
2831 </p>
2832 </dd>
2833 <dt class="hdlist1">
2834 --exit-code
2835 </dt>
2836 <dd>
2838 Make the program exit with codes similar to diff(1).
2839 That is, it exits with 1 if there were differences and
2840 0 means no differences.
2841 </p>
2842 </dd>
2843 <dt class="hdlist1">
2844 --quiet
2845 </dt>
2846 <dd>
2848 Disable all output of the program. Implies <tt>--exit-code</tt>.
2849 </p>
2850 </dd>
2851 <dt class="hdlist1">
2852 --ext-diff
2853 </dt>
2854 <dd>
2856 Allow an external diff helper to be executed. If you set an
2857 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
2858 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
2859 </p>
2860 </dd>
2861 <dt class="hdlist1">
2862 --no-ext-diff
2863 </dt>
2864 <dd>
2866 Disallow external diff drivers.
2867 </p>
2868 </dd>
2869 <dt class="hdlist1">
2870 --textconv
2871 </dt>
2872 <dt class="hdlist1">
2873 --no-textconv
2874 </dt>
2875 <dd>
2877 Allow (or disallow) external text conversion filters to be run
2878 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
2879 details. Because textconv filters are typically a one-way
2880 conversion, the resulting diff is suitable for human
2881 consumption, but cannot be applied. For this reason, textconv
2882 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
2883 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
2884 diff plumbing commands.
2885 </p>
2886 </dd>
2887 <dt class="hdlist1">
2888 --ignore-submodules[=&lt;when&gt;]
2889 </dt>
2890 <dd>
2892 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
2893 either "none", "untracked", "dirty" or "all", which is the default
2894 Using "none" will consider the submodule modified when it either contains
2895 untracked or modified files or its HEAD differs from the commit recorded
2896 in the superproject and can be used to override any settings of the
2897 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
2898 "untracked" is used submodules are not considered dirty when they only
2899 contain untracked content (but they are still scanned for modified
2900 content). Using "dirty" ignores all changes to the work tree of submodules,
2901 only changes to the commits stored in the superproject are shown (this was
2902 the behavior until 1.7.0). Using "all" hides all changes to submodules.
2903 </p>
2904 </dd>
2905 <dt class="hdlist1">
2906 --src-prefix=&lt;prefix&gt;
2907 </dt>
2908 <dd>
2910 Show the given source prefix instead of "a/".
2911 </p>
2912 </dd>
2913 <dt class="hdlist1">
2914 --dst-prefix=&lt;prefix&gt;
2915 </dt>
2916 <dd>
2918 Show the given destination prefix instead of "b/".
2919 </p>
2920 </dd>
2921 <dt class="hdlist1">
2922 --no-prefix
2923 </dt>
2924 <dd>
2926 Do not show any source or destination prefix.
2927 </p>
2928 </dd>
2929 </dl></div>
2930 <div class="paragraph"><p>For more detailed explanation on these common options, see also
2931 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
2932 </div>
2933 <h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2934 <div class="sectionbody">
2935 <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2936 with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2937 "git log" with the "-p" option, they
2938 do not produce the output described above; instead they produce a
2939 patch file. You can customize the creation of such patches via the
2940 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2941 <div class="paragraph"><p>What the -p option produces is slightly different from the traditional
2942 diff format:</p></div>
2943 <div class="olist arabic"><ol class="arabic">
2944 <li>
2946 It is preceded with a "git diff" header that looks like this:
2947 </p>
2948 <div class="literalblock">
2949 <div class="content">
2950 <pre><tt>diff --git a/file1 b/file2</tt></pre>
2951 </div></div>
2952 <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
2953 involved. Especially, even for a creation or a deletion,
2954 <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2955 <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
2956 name of the source file of the rename/copy and the name of
2957 the file that rename/copy produces, respectively.</p></div>
2958 </li>
2959 <li>
2961 It is followed by one or more extended header lines:
2962 </p>
2963 <div class="literalblock">
2964 <div class="content">
2965 <pre><tt>old mode &lt;mode&gt;
2966 new mode &lt;mode&gt;
2967 deleted file mode &lt;mode&gt;
2968 new file mode &lt;mode&gt;
2969 copy from &lt;path&gt;
2970 copy to &lt;path&gt;
2971 rename from &lt;path&gt;
2972 rename to &lt;path&gt;
2973 similarity index &lt;number&gt;
2974 dissimilarity index &lt;number&gt;
2975 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2976 </div></div>
2977 <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
2978 and file permission bits.</p></div>
2979 <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
2980 <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
2981 the dissimilarity index is the percentage of changed lines. It
2982 is a rounded down integer, followed by a percent sign. The
2983 similarity index value of 100% is thus reserved for two equal
2984 files, while 100% dissimilarity means that no line from the old
2985 file made it into the new one.</p></div>
2986 <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
2987 The &lt;mode&gt; is included if the file mode does not change; otherwise,
2988 separate lines indicate the old and the new mode.</p></div>
2989 </li>
2990 <li>
2992 TAB, LF, double quote and backslash characters in pathnames
2993 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2994 If there is need for such substitution then the whole
2995 pathname is put in double quotes.
2996 </p>
2997 </li>
2998 <li>
3000 All the <tt>file1</tt> files in the output refer to files before the
3001 commit, and all the <tt>file2</tt> files refer to files after the commit.
3002 It is incorrect to apply each change to each file sequentially. For
3003 example, this patch will swap a and b:
3004 </p>
3005 <div class="literalblock">
3006 <div class="content">
3007 <pre><tt>diff --git a/a b/b
3008 rename from a
3009 rename to b
3010 diff --git a/b b/a
3011 rename from b
3012 rename to a</tt></pre>
3013 </div></div>
3014 </li>
3015 </ol></div>
3016 </div>
3017 <h2 id="_combined_diff_format">combined diff format</h2>
3018 <div class="sectionbody">
3019 <div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
3020 produce a <em>combined diff</em> when showing a merge. This is the default
3021 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
3022 <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
3023 of these commands to force generation of diffs with individual parents
3024 of a merge.</p></div>
3025 <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
3026 <div class="listingblock">
3027 <div class="content">
3028 <pre><tt>diff --combined describe.c
3029 index fabadb8,cc95eb0..4866510
3030 --- a/describe.c
3031 +++ b/describe.c
3032 @@@ -98,20 -98,12 +98,20 @@@
3033 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
3036 - static void describe(char *arg)
3037 -static void describe(struct commit *cmit, int last_one)
3038 ++static void describe(char *arg, int last_one)
3040 + unsigned char sha1[20];
3041 + struct commit *cmit;
3042 struct commit_list *list;
3043 static int initialized = 0;
3044 struct commit_name *n;
3046 + if (get_sha1(arg, sha1) &lt; 0)
3047 + usage(describe_usage);
3048 + cmit = lookup_commit_reference(sha1);
3049 + if (!cmit)
3050 + usage(describe_usage);
3052 if (!initialized) {
3053 initialized = 1;
3054 for_each_ref(get_name);</tt></pre>
3055 </div></div>
3056 <div class="olist arabic"><ol class="arabic">
3057 <li>
3059 It is preceded with a "git diff" header, that looks like
3060 this (when <em>-c</em> option is used):
3061 </p>
3062 <div class="literalblock">
3063 <div class="content">
3064 <pre><tt>diff --combined file</tt></pre>
3065 </div></div>
3066 <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
3067 <div class="literalblock">
3068 <div class="content">
3069 <pre><tt>diff --cc file</tt></pre>
3070 </div></div>
3071 </li>
3072 <li>
3074 It is followed by one or more extended header lines
3075 (this example shows a merge with two parents):
3076 </p>
3077 <div class="literalblock">
3078 <div class="content">
3079 <pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
3080 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
3081 new file mode &lt;mode&gt;
3082 deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
3083 </div></div>
3084 <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
3085 the &lt;mode&gt; is different from the rest. Extended headers with
3086 information about detected contents movement (renames and
3087 copying detection) are designed to work with diff of two
3088 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
3089 </li>
3090 <li>
3092 It is followed by two-line from-file/to-file header
3093 </p>
3094 <div class="literalblock">
3095 <div class="content">
3096 <pre><tt>--- a/file
3097 +++ b/file</tt></pre>
3098 </div></div>
3099 <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
3100 format, <tt>/dev/null</tt> is used to signal created or deleted
3101 files.</p></div>
3102 </li>
3103 <li>
3105 Chunk header format is modified to prevent people from
3106 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
3107 was created for review of merge commit changes, and was not
3108 meant for apply. The change is similar to the change in the
3109 extended <em>index</em> header:
3110 </p>
3111 <div class="literalblock">
3112 <div class="content">
3113 <pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
3114 </div></div>
3115 <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
3116 header for combined diff format.</p></div>
3117 </li>
3118 </ol></div>
3119 <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
3120 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
3121 added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
3122 compares two or more files file1, file2,&#8230; with one file X, and
3123 shows how X differs from each of fileN. One column for each of
3124 fileN is prepended to the output line to note how X&#8217;s line is
3125 different from it.</p></div>
3126 <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
3127 fileN but it does not appear in the result. A <tt>+</tt> character
3128 in the column N means that the line appears in the result,
3129 and fileN does not have that line (in other words, the line was
3130 added, from the point of view of that parent).</p></div>
3131 <div class="paragraph"><p>In the above example output, the function signature was changed
3132 from both files (hence two <tt>-</tt> removals from both file1 and
3133 file2, plus <tt>++</tt> to mean one line that was added does not appear
3134 in either file1 nor file2). Also eight other lines are the same
3135 from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
3136 <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
3137 merge commit with the merge result (i.e. file1..fileN are the
3138 parents). When shown by <tt>git diff-files -c</tt>, it compares the
3139 two unresolved merge parents with the working tree file
3140 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
3141 "their version").</p></div>
3142 </div>
3143 <h2 id="_examples">Examples</h2>
3144 <div class="sectionbody">
3145 <div class="dlist"><dl>
3146 <dt class="hdlist1">
3147 <tt>git log --no-merges</tt>
3148 </dt>
3149 <dd>
3151 Show the whole commit history, but skip any merges
3152 </p>
3153 </dd>
3154 <dt class="hdlist1">
3155 <tt>git log v2.6.12.. include/scsi drivers/scsi</tt>
3156 </dt>
3157 <dd>
3159 Show all commits since version <em>v2.6.12</em> that changed any file
3160 in the include/scsi or drivers/scsi subdirectories
3161 </p>
3162 </dd>
3163 <dt class="hdlist1">
3164 <tt>git log --since="2 weeks ago" -- gitk</tt>
3165 </dt>
3166 <dd>
3168 Show the changes during the last two weeks to the file <em>gitk</em>.
3169 The "--" is necessary to avoid confusion with the <strong>branch</strong> named
3170 <em>gitk</em>
3171 </p>
3172 </dd>
3173 <dt class="hdlist1">
3174 <tt>git log --name-status release..test</tt>
3175 </dt>
3176 <dd>
3178 Show the commits that are in the "test" branch but not yet
3179 in the "release" branch, along with the list of paths
3180 each commit modifies.
3181 </p>
3182 </dd>
3183 <dt class="hdlist1">
3184 <tt>git log --follow builtin-rev-list.c</tt>
3185 </dt>
3186 <dd>
3188 Shows the commits that changed builtin-rev-list.c, including
3189 those commits that occurred before the file was given its
3190 present name.
3191 </p>
3192 </dd>
3193 <dt class="hdlist1">
3194 <tt>git log --branches --not --remotes=origin</tt>
3195 </dt>
3196 <dd>
3198 Shows all commits that are in any of local branches but not in
3199 any of remote-tracking branches for <em>origin</em> (what you have that
3200 origin doesn&#8217;t).
3201 </p>
3202 </dd>
3203 <dt class="hdlist1">
3204 <tt>git log master --not --remotes=*/master</tt>
3205 </dt>
3206 <dd>
3208 Shows all commits that are in local master but not in any remote
3209 repository master branches.
3210 </p>
3211 </dd>
3212 <dt class="hdlist1">
3213 <tt>git log -p -m --first-parent</tt>
3214 </dt>
3215 <dd>
3217 Shows the history including change diffs, but only from the
3218 "main branch" perspective, skipping commits that come from merged
3219 branches, and showing full diffs of changes introduced by the merges.
3220 This makes sense only when following a strict policy of merging all
3221 topic branches when staying on a single integration branch.
3222 </p>
3223 </dd>
3224 </dl></div>
3225 </div>
3226 <h2 id="_discussion">Discussion</h2>
3227 <div class="sectionbody">
3228 <div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div>
3229 <div class="ulist"><ul>
3230 <li>
3232 The pathnames recorded in the index and in the tree objects
3233 are treated as uninterpreted sequences of non-NUL bytes.
3234 What readdir(2) returns are what are recorded and compared
3235 with the data git keeps track of, which in turn are expected
3236 to be what lstat(2) and creat(2) accepts. There is no such
3237 thing as pathname encoding translation.
3238 </p>
3239 </li>
3240 <li>
3242 The contents of the blob objects are uninterpreted sequences
3243 of bytes. There is no encoding translation at the core
3244 level.
3245 </p>
3246 </li>
3247 <li>
3249 The commit log messages are uninterpreted sequences of non-NUL
3250 bytes.
3251 </p>
3252 </li>
3253 </ul></div>
3254 <div class="paragraph"><p>Although we encourage that the commit log messages are encoded
3255 in UTF-8, both the core and git Porcelain are designed not to
3256 force UTF-8 on projects. If all participants of a particular
3257 project find it more convenient to use legacy encodings, git
3258 does not forbid it. However, there are a few things to keep in
3259 mind.</p></div>
3260 <div class="olist arabic"><ol class="arabic">
3261 <li>
3263 <em>git commit</em> and <em>git commit-tree</em> issues
3264 a warning if the commit log message given to it does not look
3265 like a valid UTF-8 string, unless you explicitly say your
3266 project uses a legacy encoding. The way to say this is to
3267 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
3268 </p>
3269 <div class="listingblock">
3270 <div class="content">
3271 <pre><tt>[i18n]
3272 commitencoding = ISO-8859-1</tt></pre>
3273 </div></div>
3274 <div class="paragraph"><p>Commit objects created with the above setting record the value
3275 of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
3276 help other people who look at them later. Lack of this header
3277 implies that the commit log message is encoded in UTF-8.</p></div>
3278 </li>
3279 <li>
3281 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
3282 <tt>encoding</tt> header of a commit object, and try to re-code the
3283 log message into UTF-8 unless otherwise specified. You can
3284 specify the desired output encoding with
3285 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
3286 </p>
3287 <div class="listingblock">
3288 <div class="content">
3289 <pre><tt>[i18n]
3290 logoutputencoding = ISO-8859-1</tt></pre>
3291 </div></div>
3292 <div class="paragraph"><p>If you do not have this configuration variable, the value of
3293 <tt>i18n.commitencoding</tt> is used instead.</p></div>
3294 </li>
3295 </ol></div>
3296 <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
3297 message when a commit is made to force UTF-8 at the commit
3298 object level, because re-coding to UTF-8 is not necessarily a
3299 reversible operation.</p></div>
3300 </div>
3301 <h2 id="_configuration">Configuration</h2>
3302 <div class="sectionbody">
3303 <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>
3304 for settings related to diff generation.</p></div>
3305 <div class="dlist"><dl>
3306 <dt class="hdlist1">
3307 format.pretty
3308 </dt>
3309 <dd>
3311 Default for the <tt>--format</tt> option. (See "PRETTY FORMATS" above.)
3312 Defaults to "medium".
3313 </p>
3314 </dd>
3315 <dt class="hdlist1">
3316 i18n.logOutputEncoding
3317 </dt>
3318 <dd>
3320 Encoding to use when displaying logs. (See "Discussion", above.)
3321 Defaults to the value of <tt>i18n.commitEncoding</tt> if set, UTF-8
3322 otherwise.
3323 </p>
3324 </dd>
3325 <dt class="hdlist1">
3326 log.date
3327 </dt>
3328 <dd>
3330 Default format for human-readable dates. (Compare the
3331 <tt>--date</tt> option.) Defaults to "default", which means to write
3332 dates like <tt>Sat May 8 19:35:34 2010 -0500</tt>.
3333 </p>
3334 </dd>
3335 <dt class="hdlist1">
3336 log.showroot
3337 </dt>
3338 <dd>
3340 If <tt>false</tt>, <em>git log</em> and related commands will not treat the
3341 initial commit as a big creation event. Any root commits in
3342 <tt>git log -p</tt> output would be shown without a diff attached.
3343 The default is <tt>true</tt>.
3344 </p>
3345 </dd>
3346 <dt class="hdlist1">
3347 mailmap.file
3348 </dt>
3349 <dd>
3351 See <a href="git-shortlog.html">git-shortlog(1)</a>.
3352 </p>
3353 </dd>
3354 <dt class="hdlist1">
3355 notes.displayRef
3356 </dt>
3357 <dd>
3359 Which refs, in addition to the default set by <tt>core.notesRef</tt>
3360 or <em>GIT_NOTES_REF</em>, to read notes from when showing commit
3361 messages with the <em>log</em> family of commands. See
3362 <a href="git-notes.html">git-notes(1)</a>.
3363 </p>
3364 <div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
3365 multiple times. A warning will be issued for refs that do not exist,
3366 but a glob that does not match any refs is silently ignored.</p></div>
3367 <div class="paragraph"><p>This setting can be disabled by the <tt>--no-notes</tt> option,
3368 overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable,
3369 and overridden by the <tt>--notes=&lt;ref&gt;</tt> option.</p></div>
3370 </dd>
3371 </dl></div>
3372 </div>
3373 <h2 id="_git">GIT</h2>
3374 <div class="sectionbody">
3375 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
3376 </div>
3377 </div>
3378 <div id="footnotes"><hr /></div>
3379 <div id="footer">
3380 <div id="footer-text">
3381 Last updated 2011-09-21 23:01:14 PDT
3382 </div>
3383 </div>
3384 </body>
3385 </html>