Autogenerated HTML docs for v1.7.6-549-gf85a0
[git/jnareb-git.git] / git-log.html
blob1e0c55b2de8f442a70071b46f5a3a5e53fe6dc0e
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.4.5" />
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.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-log(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-log -
411 Show commit logs
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git log</em> [&lt;options&gt;] [&lt;since&gt;..&lt;until&gt;] [[--] &lt;path&gt;&#8230;]</div>
419 <div class="verseblock-attribution">
420 </div></div>
421 </div>
422 <h2 id="_description">DESCRIPTION</h2>
423 <div class="sectionbody">
424 <div class="paragraph"><p>Shows the commit logs.</p></div>
425 <div class="paragraph"><p>The command takes options applicable to the <em>git rev-list</em>
426 command to control what is shown and how, and options applicable to
427 the <em>git diff-*</em> commands to control how the changes
428 each commit introduces are shown.</p></div>
429 </div>
430 <h2 id="_options">OPTIONS</h2>
431 <div class="sectionbody">
432 <div class="dlist"><dl>
433 <dt class="hdlist1">
434 -&lt;n&gt;
435 </dt>
436 <dd>
438 Limits the number of commits to show.
439 Note that this is a commit limiting option, see below.
440 </p>
441 </dd>
442 <dt class="hdlist1">
443 &lt;since&gt;..&lt;until&gt;
444 </dt>
445 <dd>
447 Show only commits between the named two commits. When
448 either &lt;since&gt; or &lt;until&gt; is omitted, it defaults to
449 <tt>HEAD</tt>, i.e. the tip of the current branch.
450 For a more complete list of ways to spell &lt;since&gt;
451 and &lt;until&gt;, see <a href="gitrevisions.html">gitrevisions(7)</a>.
452 </p>
453 </dd>
454 <dt class="hdlist1">
455 --follow
456 </dt>
457 <dd>
459 Continue listing the history of a file beyond renames
460 (works only for a single file).
461 </p>
462 </dd>
463 <dt class="hdlist1">
464 --no-decorate
465 </dt>
466 <dt class="hdlist1">
467 --decorate[=short|full|no]
468 </dt>
469 <dd>
471 Print out the ref names of any commits that are shown. If <em>short</em> is
472 specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and
473 <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the
474 full ref name (including prefix) will be printed. The default option
475 is <em>short</em>.
476 </p>
477 </dd>
478 <dt class="hdlist1">
479 --source
480 </dt>
481 <dd>
483 Print out the ref name given on the command line by which each
484 commit was reached.
485 </p>
486 </dd>
487 <dt class="hdlist1">
488 --full-diff
489 </dt>
490 <dd>
492 Without this flag, "git log -p &lt;path&gt;&#8230;" shows commits that
493 touch the specified paths, and diffs about the same specified
494 paths. With this, the full diff is shown for commits that touch
495 the specified paths; this means that "&lt;path&gt;&#8230;" limits only
496 commits, and doesn&#8217;t limit diff for those commits.
497 </p>
498 <div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those
499 produced by --stat etc.</p></div>
500 </dd>
501 <dt class="hdlist1">
502 --log-size
503 </dt>
504 <dd>
506 Before the log message print out its size in bytes. Intended
507 mainly for porcelain tools consumption. If git is unable to
508 produce a valid value size is set to zero.
509 Note that only message is considered, if also a diff is shown
510 its size is not included.
511 </p>
512 </dd>
513 <dt class="hdlist1">
514 [--] &lt;path&gt;&#8230;
515 </dt>
516 <dd>
518 Show only commits that affect any of the specified paths. To
519 prevent confusion with options and branch names, paths may need
520 to be prefixed with "-- " to separate them from options or
521 refnames.
522 </p>
523 </dd>
524 </dl></div>
525 <h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div>
526 <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the
527 special notations explained in the description, additional commit
528 limiting may be applied. Note that they are applied before commit
529 ordering and formatting options, such as <em>--reverse</em>.</p></div>
530 <div class="dlist"><dl>
531 <dt class="hdlist1">
532 -n <em>number</em>
533 </dt>
534 <dt class="hdlist1">
535 --max-count=&lt;number&gt;
536 </dt>
537 <dd>
539 Limit the number of commits to output.
540 </p>
541 </dd>
542 <dt class="hdlist1">
543 --skip=&lt;number&gt;
544 </dt>
545 <dd>
547 Skip <em>number</em> commits before starting to show the commit output.
548 </p>
549 </dd>
550 <dt class="hdlist1">
551 --since=&lt;date&gt;
552 </dt>
553 <dt class="hdlist1">
554 --after=&lt;date&gt;
555 </dt>
556 <dd>
558 Show commits more recent than a specific date.
559 </p>
560 </dd>
561 <dt class="hdlist1">
562 --until=&lt;date&gt;
563 </dt>
564 <dt class="hdlist1">
565 --before=&lt;date&gt;
566 </dt>
567 <dd>
569 Show commits older than a specific date.
570 </p>
571 </dd>
572 <dt class="hdlist1">
573 --author=&lt;pattern&gt;
574 </dt>
575 <dt class="hdlist1">
576 --committer=&lt;pattern&gt;
577 </dt>
578 <dd>
580 Limit the commits output to ones with author/committer
581 header lines that match the specified pattern (regular expression).
582 </p>
583 </dd>
584 <dt class="hdlist1">
585 --grep=&lt;pattern&gt;
586 </dt>
587 <dd>
589 Limit the commits output to ones with log message that
590 matches the specified pattern (regular expression).
591 </p>
592 </dd>
593 <dt class="hdlist1">
594 --all-match
595 </dt>
596 <dd>
598 Limit the commits output to ones that match all given --grep,
599 --author and --committer instead of ones that match at least one.
600 </p>
601 </dd>
602 <dt class="hdlist1">
604 </dt>
605 <dt class="hdlist1">
606 --regexp-ignore-case
607 </dt>
608 <dd>
610 Match the regexp limiting patterns without regard to letters case.
611 </p>
612 </dd>
613 <dt class="hdlist1">
615 </dt>
616 <dt class="hdlist1">
617 --extended-regexp
618 </dt>
619 <dd>
621 Consider the limiting patterns to be extended regular expressions
622 instead of the default basic regular expressions.
623 </p>
624 </dd>
625 <dt class="hdlist1">
627 </dt>
628 <dt class="hdlist1">
629 --fixed-strings
630 </dt>
631 <dd>
633 Consider the limiting patterns to be fixed strings (don&#8217;t interpret
634 pattern as a regular expression).
635 </p>
636 </dd>
637 <dt class="hdlist1">
638 --remove-empty
639 </dt>
640 <dd>
642 Stop when a given path disappears from the tree.
643 </p>
644 </dd>
645 <dt class="hdlist1">
646 --merges
647 </dt>
648 <dd>
650 Print only merge commits. This is exactly the same as <tt>--min-parents=2</tt>.
651 </p>
652 </dd>
653 <dt class="hdlist1">
654 --no-merges
655 </dt>
656 <dd>
658 Do not print commits with more than one parent. This is
659 exactly the same as <tt>--max-parents=1</tt>.
660 </p>
661 </dd>
662 <dt class="hdlist1">
663 --min-parents=&lt;number&gt;
664 </dt>
665 <dt class="hdlist1">
666 --max-parents=&lt;number&gt;
667 </dt>
668 <dt class="hdlist1">
669 --no-min-parents
670 </dt>
671 <dt class="hdlist1">
672 --no-max-parents
673 </dt>
674 <dd>
676 Show only commits which have at least (or at most) that many
677 commits. In particular, <tt>--max-parents=1</tt> is the same as <tt>--no-merges</tt>,
678 <tt>--min-parents=2</tt> is the same as <tt>--merges</tt>. <tt>--max-parents=0</tt>
679 gives all root commits and <tt>--min-parents=3</tt> all octopus merges.
680 </p>
681 <div class="paragraph"><p><tt>--no-min-parents</tt> and <tt>--no-max-parents</tt> reset these limits (to no limit)
682 again. Equivalent forms are <tt>--min-parents=0</tt> (any commit has 0 or more
683 parents) and <tt>--max-parents=-1</tt> (negative numbers denote no upper limit).</p></div>
684 </dd>
685 <dt class="hdlist1">
686 --first-parent
687 </dt>
688 <dd>
690 Follow only the first parent commit upon seeing a merge
691 commit. This option can give a better overview when
692 viewing the evolution of a particular topic branch,
693 because merges into a topic branch tend to be only about
694 adjusting to updated upstream from time to time, and
695 this option allows you to ignore the individual commits
696 brought in to your history by such a merge.
697 </p>
698 </dd>
699 <dt class="hdlist1">
700 --not
701 </dt>
702 <dd>
704 Reverses the meaning of the <em>&#94;</em> prefix (or lack thereof)
705 for all following revision specifiers, up to the next <em>--not</em>.
706 </p>
707 </dd>
708 <dt class="hdlist1">
709 --all
710 </dt>
711 <dd>
713 Pretend as if all the refs in <tt>refs/</tt> are listed on the
714 command line as <em>&lt;commit&gt;</em>.
715 </p>
716 </dd>
717 <dt class="hdlist1">
718 --branches[=&lt;pattern&gt;]
719 </dt>
720 <dd>
722 Pretend as if all the refs in <tt>refs/heads</tt> are listed
723 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
724 branches to ones matching given shell glob. If pattern lacks <em>?</em>,
725 <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
726 </p>
727 </dd>
728 <dt class="hdlist1">
729 --tags[=&lt;pattern&gt;]
730 </dt>
731 <dd>
733 Pretend as if all the refs in <tt>refs/tags</tt> are listed
734 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
735 tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em><strong></em>,
736 or <em>[</em>, <em>/</strong></em> at the end is implied.
737 </p>
738 </dd>
739 <dt class="hdlist1">
740 --remotes[=&lt;pattern&gt;]
741 </dt>
742 <dd>
744 Pretend as if all the refs in <tt>refs/remotes</tt> are listed
745 on the command line as <em>&lt;commit&gt;</em>. If <em>&lt;pattern&gt;</em> is given, limit
746 remote-tracking branches to ones matching given shell glob.
747 If pattern lacks <em>?</em>, <em><strong></em>, or <em>[</em>, <em>/</strong></em> at the end is implied.
748 </p>
749 </dd>
750 <dt class="hdlist1">
751 --glob=&lt;glob-pattern&gt;
752 </dt>
753 <dd>
755 Pretend as if all the refs matching shell glob <em>&lt;glob-pattern&gt;</em>
756 are listed on the command line as <em>&lt;commit&gt;</em>. Leading <em>refs/</em>,
757 is automatically prepended if missing. If pattern lacks <em>?</em>, <em><strong></em>,
758 or <em>[</em>, <em>/</strong></em> at the end is implied.
759 </p>
760 </dd>
761 <dt class="hdlist1">
762 --ignore-missing
763 </dt>
764 <dd>
766 Upon seeing an invalid object name in the input, pretend as if
767 the bad input was not given.
768 </p>
769 </dd>
770 <dt class="hdlist1">
771 --bisect
772 </dt>
773 <dd>
775 Pretend as if the bad bisection ref <tt>refs/bisect/bad</tt>
776 was listed and as if it was followed by <tt>--not</tt> and the good
777 bisection refs <tt>refs/bisect/good-*</tt> on the command
778 line.
779 </p>
780 </dd>
781 <dt class="hdlist1">
782 --stdin
783 </dt>
784 <dd>
786 In addition to the <em>&lt;commit&gt;</em> listed on the command
787 line, read them from the standard input. If a <em>--</em> separator is
788 seen, stop reading commits and start reading paths to limit the
789 result.
790 </p>
791 </dd>
792 <dt class="hdlist1">
793 --cherry-mark
794 </dt>
795 <dd>
797 Like <tt>--cherry-pick</tt> (see below) but mark equivalent commits
798 with <tt>=</tt> rather than omitting them, and inequivalent ones with <tt>+</tt>.
799 </p>
800 </dd>
801 <dt class="hdlist1">
802 --cherry-pick
803 </dt>
804 <dd>
806 Omit any commit that introduces the same change as
807 another commit on the "other side" when the set of
808 commits are limited with symmetric difference.
809 </p>
810 <div class="paragraph"><p>For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way
811 to list all commits on only one side of them is with
812 <tt>--left-right</tt> (see the example below in the description of
813 the <tt>--left-right</tt> option). It however shows the commits that were cherry-picked
814 from the other branch (for example, "3rd on b" may be cherry-picked
815 from branch A). With this option, such pairs of commits are
816 excluded from the output.</p></div>
817 </dd>
818 <dt class="hdlist1">
819 --left-only
820 </dt>
821 <dt class="hdlist1">
822 --right-only
823 </dt>
824 <dd>
826 List only commits on the respective side of a symmetric range,
827 i.e. only those which would be marked <tt>&lt;</tt> resp. <tt>&gt;</tt> by
828 <tt>--left-right</tt>.
829 </p>
830 <div class="paragraph"><p>For example, <tt>--cherry-pick --right-only A&#8230;B</tt> omits those
831 commits from <tt>B</tt> which are in <tt>A</tt> or are patch-equivalent to a commit in
832 <tt>A</tt>. In other words, this lists the <tt>&#43;</tt> commits from <tt>git cherry A B</tt>.
833 More precisely, <tt>--cherry-pick --right-only --no-merges</tt> gives the exact
834 list.</p></div>
835 </dd>
836 <dt class="hdlist1">
837 --cherry
838 </dt>
839 <dd>
841 A synonym for <tt>--right-only --cherry-mark --no-merges</tt>; useful to
842 limit the output to the commits on our side and mark those that
843 have been applied to the other side of a forked history with
844 <tt>git log --cherry upstream&#8230;mybranch</tt>, similar to
845 <tt>git cherry upstream mybranch</tt>.
846 </p>
847 </dd>
848 <dt class="hdlist1">
850 </dt>
851 <dt class="hdlist1">
852 --walk-reflogs
853 </dt>
854 <dd>
856 Instead of walking the commit ancestry chain, walk
857 reflog entries from the most recent one to older ones.
858 When this option is used you cannot specify commits to
859 exclude (that is, <em>&#94;commit</em>, <em>commit1..commit2</em>,
860 nor <em>commit1...commit2</em> notations cannot be used).
861 </p>
862 <div class="paragraph"><p>With <em>--pretty</em> format other than oneline (for obvious reasons),
863 this causes the output to have two extra lines of information
864 taken from the reflog. By default, <em>commit@{Nth}</em> notation is
865 used in the output. When the starting commit is specified as
866 <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation
867 instead. Under <em>--pretty=oneline</em>, the commit message is
868 prefixed with this information on the same line.
869 This option cannot be combined with <em>--reverse</em>.
870 See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div>
871 </dd>
872 <dt class="hdlist1">
873 --merge
874 </dt>
875 <dd>
877 After a failed merge, show refs that touch files having a
878 conflict and don&#8217;t exist on all heads to merge.
879 </p>
880 </dd>
881 <dt class="hdlist1">
882 --boundary
883 </dt>
884 <dd>
886 Output uninteresting commits at the boundary, which are usually
887 not shown.
888 </p>
889 </dd>
890 </dl></div>
891 <h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div>
892 <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the
893 commits modifying a particular &lt;path&gt;. But there are two parts of
894 <em>History Simplification</em>, one part is selecting the commits and the other
895 is how to do it, as there are various strategies to simplify the history.</p></div>
896 <div class="paragraph"><p>The following options select the commits to be shown:</p></div>
897 <div class="dlist"><dl>
898 <dt class="hdlist1">
899 &lt;paths&gt;
900 </dt>
901 <dd>
903 Commits modifying the given &lt;paths&gt; are selected.
904 </p>
905 </dd>
906 <dt class="hdlist1">
907 --simplify-by-decoration
908 </dt>
909 <dd>
911 Commits that are referred by some branch or tag are selected.
912 </p>
913 </dd>
914 </dl></div>
915 <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div>
916 <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div>
917 <div class="dlist"><dl>
918 <dt class="hdlist1">
919 Default mode
920 </dt>
921 <dd>
923 Simplifies the history to the simplest history explaining the
924 final state of the tree. Simplest because it prunes some side
925 branches if the end result is the same (i.e. merging branches
926 with the same content)
927 </p>
928 </dd>
929 <dt class="hdlist1">
930 --full-history
931 </dt>
932 <dd>
934 Same as the default mode, but does not prune some history.
935 </p>
936 </dd>
937 <dt class="hdlist1">
938 --dense
939 </dt>
940 <dd>
942 Only the selected commits are shown, plus some to have a
943 meaningful history.
944 </p>
945 </dd>
946 <dt class="hdlist1">
947 --sparse
948 </dt>
949 <dd>
951 All commits in the simplified history are shown.
952 </p>
953 </dd>
954 <dt class="hdlist1">
955 --simplify-merges
956 </dt>
957 <dd>
959 Additional option to <em>--full-history</em> to remove some needless
960 merges from the resulting history, as there are no selected
961 commits contributing to this merge.
962 </p>
963 </dd>
964 <dt class="hdlist1">
965 --ancestry-path
966 </dt>
967 <dd>
969 When given a range of commits to display (e.g. <em>commit1..commit2</em>
970 or <em>commit2 &#94;commit1</em>), only display commits that exist
971 directly on the ancestry chain between the <em>commit1</em> and
972 <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>,
973 and ancestors of <em>commit2</em>.
974 </p>
975 </dd>
976 </dl></div>
977 <div class="paragraph"><p>A more detailed explanation follows.</p></div>
978 <div class="paragraph"><p>Suppose you specified <tt>foo</tt> as the &lt;paths&gt;. We shall call commits
979 that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff
980 filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div>
981 <div class="paragraph"><p>In the following, we will always refer to the same example history to
982 illustrate the differences between simplification settings. We assume
983 that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div>
984 <div class="listingblock">
985 <div class="content">
986 <pre><tt> .-A---M---N---O---P
987 / / / / /
988 I B C D E
989 \ / / / /
990 `-------------'</tt></pre>
991 </div></div>
992 <div class="paragraph"><p>The horizontal line of history A---P is taken to be the first parent of
993 each merge. The commits are:</p></div>
994 <div class="ulist"><ul>
995 <li>
997 <tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents
998 "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial
999 commits are compared to an empty tree, so <tt>I</tt> is !TREESAME.
1000 </p>
1001 </li>
1002 <li>
1004 In <tt>A</tt>, <tt>foo</tt> contains just "foo".
1005 </p>
1006 </li>
1007 <li>
1009 <tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and
1010 hence TREESAME to all parents.
1011 </p>
1012 </li>
1013 <li>
1015 <tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar",
1016 so it is not TREESAME to any parent.
1017 </p>
1018 </li>
1019 <li>
1021 <tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from
1022 <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent.
1023 </p>
1024 </li>
1025 <li>
1027 <tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the
1028 strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is
1029 TREESAME to all parents.
1030 </p>
1031 </li>
1032 </ul></div>
1033 <div class="paragraph"><p><em>rev-list</em> walks backwards through history, including or excluding
1034 commits based on whether <em>--full-history</em> and/or parent rewriting
1035 (via <em>--parents</em> or <em>--children</em>) are used. The following settings
1036 are available.</p></div>
1037 <div class="dlist"><dl>
1038 <dt class="hdlist1">
1039 Default mode
1040 </dt>
1041 <dd>
1043 Commits are included if they are not TREESAME to any parent
1044 (though this can be changed, see <em>--sparse</em> below). If the
1045 commit was a merge, and it was TREESAME to one parent, follow
1046 only that parent. (Even if there are several TREESAME
1047 parents, follow only one of them.) Otherwise, follow all
1048 parents.
1049 </p>
1050 <div class="paragraph"><p>This results in:</p></div>
1051 <div class="listingblock">
1052 <div class="content">
1053 <pre><tt> .-A---N---O
1054 / / /
1055 I---------D</tt></pre>
1056 </div></div>
1057 <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is
1058 available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was
1059 considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an
1060 empty tree, so <tt>I</tt> is !TREESAME.</p></div>
1061 <div class="paragraph"><p>Parent/child relations are only visible with --parents, but that does
1062 not affect the commits selected in default mode, so we have shown the
1063 parent lines.</p></div>
1064 </dd>
1065 <dt class="hdlist1">
1066 --full-history without parent rewriting
1067 </dt>
1068 <dd>
1070 This mode differs from the default in one point: always follow
1071 all parents of a merge, even if it is TREESAME to one of them.
1072 Even if more than one side of the merge has commits that are
1073 included, this does not imply that the merge itself is! In
1074 the example, we get
1075 </p>
1076 <div class="listingblock">
1077 <div class="content">
1078 <pre><tt> I A B N D O</tt></pre>
1079 </div></div>
1080 <div class="paragraph"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>,
1081 <tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others
1082 do not appear.</p></div>
1083 <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk
1084 about the parent/child relationships between the commits, so we show
1085 them disconnected.</p></div>
1086 </dd>
1087 <dt class="hdlist1">
1088 --full-history with parent rewriting
1089 </dt>
1090 <dd>
1092 Ordinary commits are only included if they are !TREESAME
1093 (though this can be changed, see <em>--sparse</em> below).
1094 </p>
1095 <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten:
1096 Along each parent, prune away commits that are not included
1097 themselves. This results in</p></div>
1098 <div class="listingblock">
1099 <div class="content">
1100 <pre><tt> .-A---M---N---O---P
1101 / / / / /
1102 I B / D /
1103 \ / / / /
1104 `-------------'</tt></pre>
1105 </div></div>
1106 <div class="paragraph"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt>
1107 was pruned away because it is TREESAME, but the parent list of P was
1108 rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and
1109 <tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div>
1110 </dd>
1111 </dl></div>
1112 <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME
1113 affects inclusion:</p></div>
1114 <div class="dlist"><dl>
1115 <dt class="hdlist1">
1116 --dense
1117 </dt>
1118 <dd>
1120 Commits that are walked are included if they are not TREESAME
1121 to any parent.
1122 </p>
1123 </dd>
1124 <dt class="hdlist1">
1125 --sparse
1126 </dt>
1127 <dd>
1129 All commits that are walked are included.
1130 </p>
1131 <div class="paragraph"><p>Note that without <em>--full-history</em>, this still simplifies merges: if
1132 one of the parents is TREESAME, we follow only that one, so the other
1133 sides of the merge are never walked.</p></div>
1134 </dd>
1135 <dt class="hdlist1">
1136 --simplify-merges
1137 </dt>
1138 <dd>
1140 First, build a history graph in the same way that
1141 <em>--full-history</em> with parent rewriting does (see above).
1142 </p>
1143 <div class="paragraph"><p>Then simplify each commit &#8216;C` to its replacement <tt>C&#8217;</tt> in the final
1144 history according to the following rules:</p></div>
1145 <div class="ulist"><ul>
1146 <li>
1148 Set &#8216;C&#8217;` to <tt>C</tt>.
1149 </p>
1150 </li>
1151 <li>
1153 Replace each parent &#8216;P` of <tt>C&#8217;</tt> with its simplification &#8216;P&#8217;`. In
1154 the process, drop parents that are ancestors of other parents, and
1155 remove duplicates.
1156 </p>
1157 </li>
1158 <li>
1160 If after this parent rewriting, &#8216;C&#8217;` is a root or merge commit (has
1161 zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
1162 Otherwise, it is replaced with its only parent.
1163 </p>
1164 </li>
1165 </ul></div>
1166 <div class="paragraph"><p>The effect of this is best shown by way of comparing to
1167 <em>--full-history</em> with parent rewriting. The example turns into:</p></div>
1168 <div class="listingblock">
1169 <div class="content">
1170 <pre><tt> .-A---M---N---O
1171 / / /
1172 I B D
1173 \ / /
1174 `---------'</tt></pre>
1175 </div></div>
1176 <div class="paragraph"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div>
1177 <div class="ulist"><ul>
1178 <li>
1180 <tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the
1181 other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.
1182 </p>
1183 </li>
1184 <li>
1186 <tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then
1187 removed completely, because it had one parent and is TREESAME.
1188 </p>
1189 </li>
1190 </ul></div>
1191 </dd>
1192 </dl></div>
1193 <div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div>
1194 <div class="dlist"><dl>
1195 <dt class="hdlist1">
1196 --ancestry-path
1197 </dt>
1198 <dd>
1200 Limit the displayed commits to those directly on the ancestry
1201 chain between the "from" and "to" commits in the given commit
1202 range. I.e. only display commits that are ancestor of the "to"
1203 commit, and descendants of the "from" commit.
1204 </p>
1205 <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div>
1206 <div class="listingblock">
1207 <div class="content">
1208 <pre><tt> D---E-------F
1209 / \ \
1210 B---C---G---H---I---J
1212 A-------K---------------L--M</tt></pre>
1213 </div></div>
1214 <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <tt>M</tt>,
1215 but excludes the ones that are ancestors of <tt>D</tt>. This is useful to see
1216 what happened to the history leading to <tt>M</tt> since <tt>D</tt>, in the sense
1217 that "what does <tt>M</tt> have that did not exist in <tt>D</tt>". The result in this
1218 example would be all the commits, except <tt>A</tt> and <tt>B</tt> (and <tt>D</tt> itself,
1219 of course).</p></div>
1220 <div class="paragraph"><p>When we want to find out what commits in <tt>M</tt> are contaminated with the
1221 bug introduced by <tt>D</tt> and need fixing, however, we might want to view
1222 only the subset of <em>D..M</em> that are actually descendants of <tt>D</tt>, i.e.
1223 excluding <tt>C</tt> and <tt>K</tt>. This is exactly what the <em>--ancestry-path</em>
1224 option does. Applied to the <em>D..M</em> range, it results in:</p></div>
1225 <div class="listingblock">
1226 <div class="content">
1227 <pre><tt> E-------F
1229 G---H---I---J
1231 L--M</tt></pre>
1232 </div></div>
1233 </dd>
1234 </dl></div>
1235 <div class="paragraph"><p>The <em>--simplify-by-decoration</em> option allows you to view only the
1236 big picture of the topology of the history, by omitting commits
1237 that are not referenced by tags. Commits are marked as !TREESAME
1238 (in other words, kept after history simplification rules described
1239 above) if (1) they are referenced by tags, or (2) they change the
1240 contents of the paths given on the command line. All other
1241 commits are marked as TREESAME (subject to be simplified away).</p></div>
1242 <h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div>
1243 <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div>
1244 <div class="dlist"><dl>
1245 <dt class="hdlist1">
1246 --topo-order
1247 </dt>
1248 <dd>
1250 This option makes them appear in topological order (i.e.
1251 descendant commits are shown before their parents).
1252 </p>
1253 </dd>
1254 <dt class="hdlist1">
1255 --date-order
1256 </dt>
1257 <dd>
1259 This option is similar to <em>--topo-order</em> in the sense that no
1260 parent comes before all of its children, but otherwise things
1261 are still ordered in the commit timestamp order.
1262 </p>
1263 </dd>
1264 <dt class="hdlist1">
1265 --reverse
1266 </dt>
1267 <dd>
1269 Output the commits in reverse order.
1270 Cannot be combined with <em>--walk-reflogs</em>.
1271 </p>
1272 </dd>
1273 </dl></div>
1274 <h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div>
1275 <div class="paragraph"><p>These options are mostly targeted for packing of git repositories.</p></div>
1276 <div class="dlist"><dl>
1277 <dt class="hdlist1">
1278 --objects
1279 </dt>
1280 <dd>
1282 Print the object IDs of any object referenced by the listed
1283 commits. <em>--objects foo ^bar</em> thus means "send me
1284 all object IDs which I need to download if I have the commit
1285 object <em>bar</em>, but not <em>foo</em>".
1286 </p>
1287 </dd>
1288 <dt class="hdlist1">
1289 --objects-edge
1290 </dt>
1291 <dd>
1293 Similar to <em>--objects</em>, but also print the IDs of excluded
1294 commits prefixed with a "-" character. This is used by
1295 <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records
1296 objects in deltified form based on objects contained in these
1297 excluded commits to reduce network traffic.
1298 </p>
1299 </dd>
1300 <dt class="hdlist1">
1301 --unpacked
1302 </dt>
1303 <dd>
1305 Only useful with <em>--objects</em>; print the object IDs that are not
1306 in packs.
1307 </p>
1308 </dd>
1309 <dt class="hdlist1">
1310 --no-walk
1311 </dt>
1312 <dd>
1314 Only show the given revs, but do not traverse their ancestors.
1315 </p>
1316 </dd>
1317 <dt class="hdlist1">
1318 --do-walk
1319 </dt>
1320 <dd>
1322 Overrides a previous --no-walk.
1323 </p>
1324 </dd>
1325 </dl></div>
1326 <h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div>
1327 <div class="dlist"><dl>
1328 <dt class="hdlist1">
1329 --pretty[=&lt;format&gt;]
1330 </dt>
1331 <dt class="hdlist1">
1332 --format=&lt;format&gt;
1333 </dt>
1334 <dd>
1336 Pretty-print the contents of the commit logs in a given format,
1337 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1338 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1339 the "PRETTY FORMATS" section for some additional details for each
1340 format. When omitted, the format defaults to <em>medium</em>.
1341 </p>
1342 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
1343 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
1344 </dd>
1345 <dt class="hdlist1">
1346 --abbrev-commit
1347 </dt>
1348 <dd>
1350 Instead of showing the full 40-byte hexadecimal commit object
1351 name, show only a partial prefix. Non default number of
1352 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1353 diff output, if it is displayed).
1354 </p>
1355 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1356 people using 80-column terminals.</p></div>
1357 </dd>
1358 <dt class="hdlist1">
1359 --no-abbrev-commit
1360 </dt>
1361 <dd>
1363 Show the full 40-byte hexadecimal commit object name. This negates
1364 <tt>--abbrev-commit</tt> and those options which imply it such as
1365 "--oneline". It also overrides the <em>log.abbrevCommit</em> variable.
1366 </p>
1367 </dd>
1368 <dt class="hdlist1">
1369 --oneline
1370 </dt>
1371 <dd>
1373 This is a shorthand for "--pretty=oneline --abbrev-commit"
1374 used together.
1375 </p>
1376 </dd>
1377 <dt class="hdlist1">
1378 --encoding[=&lt;encoding&gt;]
1379 </dt>
1380 <dd>
1382 The commit objects record the encoding used for the log message
1383 in their encoding header; this option can be used to tell the
1384 command to re-code the commit log message in the encoding
1385 preferred by the user. For non plumbing commands this
1386 defaults to UTF-8.
1387 </p>
1388 </dd>
1389 <dt class="hdlist1">
1390 --notes[=&lt;ref&gt;]
1391 </dt>
1392 <dd>
1394 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1395 commit, when showing the commit log message. This is the default
1396 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
1397 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given
1398 on the command line.
1399 </p>
1400 <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1401 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
1402 environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
1403 <div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
1404 default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it
1405 is not qualified.</p></div>
1406 <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1407 being displayed. Examples: "--notes=foo" will show only notes from
1408 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
1409 "refs/notes/foo" and from the default notes ref(s).</p></div>
1410 </dd>
1411 <dt class="hdlist1">
1412 --no-notes
1413 </dt>
1414 <dd>
1416 Do not show notes. This negates the above <tt>--notes</tt> option, by
1417 resetting the list of notes refs from which notes are shown.
1418 Options are parsed in the order given on the command line, so e.g.
1419 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1420 from "refs/notes/bar".
1421 </p>
1422 </dd>
1423 <dt class="hdlist1">
1424 --show-notes[=&lt;ref&gt;]
1425 </dt>
1426 <dt class="hdlist1">
1427 --[no-]standard-notes
1428 </dt>
1429 <dd>
1431 These options are deprecated. Use the above --notes/--no-notes
1432 options instead.
1433 </p>
1434 </dd>
1435 <dt class="hdlist1">
1436 --relative-date
1437 </dt>
1438 <dd>
1440 Synonym for <tt>--date=relative</tt>.
1441 </p>
1442 </dd>
1443 <dt class="hdlist1">
1444 --date=(relative|local|default|iso|rfc|short|raw)
1445 </dt>
1446 <dd>
1448 Only takes effect for dates shown in human-readable format, such
1449 as when using "--pretty". <tt>log.date</tt> config variable sets a default
1450 value for log command&#8217;s --date option.
1451 </p>
1452 <div class="paragraph"><p><tt>--date=relative</tt> shows dates relative to the current time,
1453 e.g. "2 hours ago".</p></div>
1454 <div class="paragraph"><p><tt>--date=local</tt> shows timestamps in user&#8217;s local timezone.</p></div>
1455 <div class="paragraph"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div>
1456 <div class="paragraph"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822
1457 format, often found in E-mail messages.</p></div>
1458 <div class="paragraph"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div>
1459 <div class="paragraph"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div>
1460 <div class="paragraph"><p><tt>--date=default</tt> shows timestamps in the original timezone
1461 (either committer&#8217;s or author&#8217;s).</p></div>
1462 </dd>
1463 <dt class="hdlist1">
1464 --parents
1465 </dt>
1466 <dd>
1468 Print also the parents of the commit (in the form "commit parent&#8230;").
1469 Also enables parent rewriting, see <em>History Simplification</em> below.
1470 </p>
1471 </dd>
1472 <dt class="hdlist1">
1473 --children
1474 </dt>
1475 <dd>
1477 Print also the children of the commit (in the form "commit child&#8230;").
1478 Also enables parent rewriting, see <em>History Simplification</em> below.
1479 </p>
1480 </dd>
1481 <dt class="hdlist1">
1482 --left-right
1483 </dt>
1484 <dd>
1486 Mark which side of a symmetric diff a commit is reachable from.
1487 Commits from the left side are prefixed with <tt>&lt;</tt> and those from
1488 the right with <tt>&gt;</tt>. If combined with <tt>--boundary</tt>, those
1489 commits are prefixed with <tt>-</tt>.
1490 </p>
1491 <div class="paragraph"><p>For example, if you have this topology:</p></div>
1492 <div class="listingblock">
1493 <div class="content">
1494 <pre><tt> y---b---b branch B
1495 / \ /
1497 / / \
1498 o---x---a---a branch A</tt></pre>
1499 </div></div>
1500 <div class="paragraph"><p>you would get an output like this:</p></div>
1501 <div class="listingblock">
1502 <div class="content">
1503 <pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B
1505 &gt;bbbbbbb... 3rd on b
1506 &gt;bbbbbbb... 2nd on b
1507 &lt;aaaaaaa... 3rd on a
1508 &lt;aaaaaaa... 2nd on a
1509 -yyyyyyy... 1st on b
1510 -xxxxxxx... 1st on a</tt></pre>
1511 </div></div>
1512 </dd>
1513 <dt class="hdlist1">
1514 --graph
1515 </dt>
1516 <dd>
1518 Draw a text-based graphical representation of the commit history
1519 on the left hand side of the output. This may cause extra lines
1520 to be printed in between commits, in order for the graph history
1521 to be drawn properly.
1522 </p>
1523 <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div>
1524 <div class="paragraph"><p>This implies the <em>--topo-order</em> option by default, but the
1525 <em>--date-order</em> option may also be specified.</p></div>
1526 </dd>
1527 </dl></div>
1528 <h3 id="_diff_formatting">Diff Formatting</h3><div style="clear:left"></div>
1529 <div class="paragraph"><p>Below are listed options that control the formatting of diff output.
1530 Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff
1531 options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div>
1532 <div class="dlist"><dl>
1533 <dt class="hdlist1">
1535 </dt>
1536 <dd>
1538 With this option, diff output for a merge commit
1539 shows the differences from each of the parents to the merge result
1540 simultaneously instead of showing pairwise diff between a parent
1541 and the result one at a time. Furthermore, it lists only files
1542 which were modified from all parents.
1543 </p>
1544 </dd>
1545 <dt class="hdlist1">
1546 --cc
1547 </dt>
1548 <dd>
1550 This flag implies the <em>-c</em> options and further compresses the
1551 patch output by omitting uninteresting hunks whose contents in
1552 the parents have only two variants and the merge result picks
1553 one of them without modification.
1554 </p>
1555 </dd>
1556 <dt class="hdlist1">
1558 </dt>
1559 <dd>
1561 This flag makes the merge commits show the full diff like
1562 regular commits; for each merge parent, a separate log entry
1563 and diff is generated. An exception is that only diff against
1564 the first parent is shown when <em>--first-parent</em> option is given;
1565 in that case, the output represents the changes the merge
1566 brought <em>into</em> the then-current branch.
1567 </p>
1568 </dd>
1569 <dt class="hdlist1">
1571 </dt>
1572 <dd>
1574 Show recursive diffs.
1575 </p>
1576 </dd>
1577 <dt class="hdlist1">
1579 </dt>
1580 <dd>
1582 Show the tree objects in the diff output. This implies <em>-r</em>.
1583 </p>
1584 </dd>
1585 <dt class="hdlist1">
1587 </dt>
1588 <dd>
1590 Suppress diff output.
1591 </p>
1592 </dd>
1593 </dl></div>
1594 </div>
1595 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
1596 <div class="sectionbody">
1597 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
1598 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1599 inserted before the <em>Author:</em> line. This line begins with
1600 "Merge: " and the sha1s of ancestral commits are printed,
1601 separated by spaces. Note that the listed commits may not
1602 necessarily be the list of the <strong>direct</strong> parent commits if you
1603 have limited your view of history: for example, if you are
1604 only interested in changes related to a certain directory or
1605 file.</p></div>
1606 <div class="paragraph"><p>There are several built-in formats, and you can define
1607 additional formats by setting a pretty.&lt;name&gt;
1608 config option to either another format name, or a
1609 <em>format:</em> string, as described below (see
1610 <a href="git-config.html">git-config(1)</a>). Here are the details of the
1611 built-in formats:</p></div>
1612 <div class="ulist"><ul>
1613 <li>
1615 <em>oneline</em>
1616 </p>
1617 <div class="literalblock">
1618 <div class="content">
1619 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1620 </div></div>
1621 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
1622 </li>
1623 <li>
1625 <em>short</em>
1626 </p>
1627 <div class="literalblock">
1628 <div class="content">
1629 <pre><tt>commit &lt;sha1&gt;
1630 Author: &lt;author&gt;</tt></pre>
1631 </div></div>
1632 <div class="literalblock">
1633 <div class="content">
1634 <pre><tt>&lt;title line&gt;</tt></pre>
1635 </div></div>
1636 </li>
1637 <li>
1639 <em>medium</em>
1640 </p>
1641 <div class="literalblock">
1642 <div class="content">
1643 <pre><tt>commit &lt;sha1&gt;
1644 Author: &lt;author&gt;
1645 Date: &lt;author date&gt;</tt></pre>
1646 </div></div>
1647 <div class="literalblock">
1648 <div class="content">
1649 <pre><tt>&lt;title line&gt;</tt></pre>
1650 </div></div>
1651 <div class="literalblock">
1652 <div class="content">
1653 <pre><tt>&lt;full commit message&gt;</tt></pre>
1654 </div></div>
1655 </li>
1656 <li>
1658 <em>full</em>
1659 </p>
1660 <div class="literalblock">
1661 <div class="content">
1662 <pre><tt>commit &lt;sha1&gt;
1663 Author: &lt;author&gt;
1664 Commit: &lt;committer&gt;</tt></pre>
1665 </div></div>
1666 <div class="literalblock">
1667 <div class="content">
1668 <pre><tt>&lt;title line&gt;</tt></pre>
1669 </div></div>
1670 <div class="literalblock">
1671 <div class="content">
1672 <pre><tt>&lt;full commit message&gt;</tt></pre>
1673 </div></div>
1674 </li>
1675 <li>
1677 <em>fuller</em>
1678 </p>
1679 <div class="literalblock">
1680 <div class="content">
1681 <pre><tt>commit &lt;sha1&gt;
1682 Author: &lt;author&gt;
1683 AuthorDate: &lt;author date&gt;
1684 Commit: &lt;committer&gt;
1685 CommitDate: &lt;committer date&gt;</tt></pre>
1686 </div></div>
1687 <div class="literalblock">
1688 <div class="content">
1689 <pre><tt>&lt;title line&gt;</tt></pre>
1690 </div></div>
1691 <div class="literalblock">
1692 <div class="content">
1693 <pre><tt>&lt;full commit message&gt;</tt></pre>
1694 </div></div>
1695 </li>
1696 <li>
1698 <em>email</em>
1699 </p>
1700 <div class="literalblock">
1701 <div class="content">
1702 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
1703 From: &lt;author&gt;
1704 Date: &lt;author date&gt;
1705 Subject: [PATCH] &lt;title line&gt;</tt></pre>
1706 </div></div>
1707 <div class="literalblock">
1708 <div class="content">
1709 <pre><tt>&lt;full commit message&gt;</tt></pre>
1710 </div></div>
1711 </li>
1712 <li>
1714 <em>raw</em>
1715 </p>
1716 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
1717 stored in the commit object. Notably, the SHA1s are
1718 displayed in full, regardless of whether --abbrev or
1719 --no-abbrev are used, and <em>parents</em> information show the
1720 true parent commits, without taking grafts nor history
1721 simplification into account.</p></div>
1722 </li>
1723 <li>
1725 <em>format:&lt;string&gt;</em>
1726 </p>
1727 <div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
1728 you want to show. It works a little bit like printf format,
1729 with the notable exception that you get a newline with <em>%n</em>
1730 instead of <em>\n</em>.</p></div>
1731 <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>
1732 would show something like this:</p></div>
1733 <div class="listingblock">
1734 <div class="content">
1735 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1736 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
1737 </div></div>
1738 <div class="paragraph"><p>The placeholders are:</p></div>
1739 <div class="ulist"><ul>
1740 <li>
1742 <em>%H</em>: commit hash
1743 </p>
1744 </li>
1745 <li>
1747 <em>%h</em>: abbreviated commit hash
1748 </p>
1749 </li>
1750 <li>
1752 <em>%T</em>: tree hash
1753 </p>
1754 </li>
1755 <li>
1757 <em>%t</em>: abbreviated tree hash
1758 </p>
1759 </li>
1760 <li>
1762 <em>%P</em>: parent hashes
1763 </p>
1764 </li>
1765 <li>
1767 <em>%p</em>: abbreviated parent hashes
1768 </p>
1769 </li>
1770 <li>
1772 <em>%an</em>: author name
1773 </p>
1774 </li>
1775 <li>
1777 <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>)
1778 </p>
1779 </li>
1780 <li>
1782 <em>%ae</em>: author email
1783 </p>
1784 </li>
1785 <li>
1787 <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>)
1788 </p>
1789 </li>
1790 <li>
1792 <em>%ad</em>: author date (format respects --date= option)
1793 </p>
1794 </li>
1795 <li>
1797 <em>%aD</em>: author date, RFC2822 style
1798 </p>
1799 </li>
1800 <li>
1802 <em>%ar</em>: author date, relative
1803 </p>
1804 </li>
1805 <li>
1807 <em>%at</em>: author date, UNIX timestamp
1808 </p>
1809 </li>
1810 <li>
1812 <em>%ai</em>: author date, ISO 8601 format
1813 </p>
1814 </li>
1815 <li>
1817 <em>%cn</em>: committer name
1818 </p>
1819 </li>
1820 <li>
1822 <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>)
1823 </p>
1824 </li>
1825 <li>
1827 <em>%ce</em>: committer email
1828 </p>
1829 </li>
1830 <li>
1832 <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>)
1833 </p>
1834 </li>
1835 <li>
1837 <em>%cd</em>: committer date
1838 </p>
1839 </li>
1840 <li>
1842 <em>%cD</em>: committer date, RFC2822 style
1843 </p>
1844 </li>
1845 <li>
1847 <em>%cr</em>: committer date, relative
1848 </p>
1849 </li>
1850 <li>
1852 <em>%ct</em>: committer date, UNIX timestamp
1853 </p>
1854 </li>
1855 <li>
1857 <em>%ci</em>: committer date, ISO 8601 format
1858 </p>
1859 </li>
1860 <li>
1862 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1863 </p>
1864 </li>
1865 <li>
1867 <em>%e</em>: encoding
1868 </p>
1869 </li>
1870 <li>
1872 <em>%s</em>: subject
1873 </p>
1874 </li>
1875 <li>
1877 <em>%f</em>: sanitized subject line, suitable for a filename
1878 </p>
1879 </li>
1880 <li>
1882 <em>%b</em>: body
1883 </p>
1884 </li>
1885 <li>
1887 <em>%B</em>: raw body (unwrapped subject and body)
1888 </p>
1889 </li>
1890 <li>
1892 <em>%N</em>: commit notes
1893 </p>
1894 </li>
1895 <li>
1897 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
1898 </p>
1899 </li>
1900 <li>
1902 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
1903 </p>
1904 </li>
1905 <li>
1907 <em>%gs</em>: reflog subject
1908 </p>
1909 </li>
1910 <li>
1912 <em>%Cred</em>: switch color to red
1913 </p>
1914 </li>
1915 <li>
1917 <em>%Cgreen</em>: switch color to green
1918 </p>
1919 </li>
1920 <li>
1922 <em>%Cblue</em>: switch color to blue
1923 </p>
1924 </li>
1925 <li>
1927 <em>%Creset</em>: reset color
1928 </p>
1929 </li>
1930 <li>
1932 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
1933 </p>
1934 </li>
1935 <li>
1937 <em>%m</em>: left, right or boundary mark
1938 </p>
1939 </li>
1940 <li>
1942 <em>%n</em>: newline
1943 </p>
1944 </li>
1945 <li>
1947 <em>%%</em>: a raw <em>%</em>
1948 </p>
1949 </li>
1950 <li>
1952 <em>%x00</em>: print a byte from a hex code
1953 </p>
1954 </li>
1955 <li>
1957 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
1958 <a href="git-shortlog.html">git-shortlog(1)</a>.
1959 </p>
1960 </li>
1961 </ul></div>
1962 </li>
1963 </ul></div>
1964 <div class="admonitionblock">
1965 <table><tr>
1966 <td class="icon">
1967 <div class="title">Note</div>
1968 </td>
1969 <td class="content">Some placeholders may depend on other options given to the
1970 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
1971 insert an empty string unless we are traversing reflog entries (e.g., by
1972 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
1973 format if <tt>--decorate</tt> was not already provided on the command line.</td>
1974 </tr></table>
1975 </div>
1976 <div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
1977 is inserted immediately before the expansion if and only if the
1978 placeholder expands to a non-empty string.</p></div>
1979 <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
1980 immediately precede the expansion are deleted if and only if the
1981 placeholder expands to an empty string.</p></div>
1982 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
1983 is inserted immediately before the expansion if and only if the
1984 placeholder expands to a non-empty string.</p></div>
1985 <div class="ulist"><ul>
1986 <li>
1988 <em>tformat:</em>
1989 </p>
1990 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
1991 provides "terminator" semantics instead of "separator" semantics. In
1992 other words, each commit has the message terminator character (usually a
1993 newline) appended, rather than a separator placed between entries.
1994 This means that the final entry of a single-line format will be properly
1995 terminated with a new line, just as the "oneline" format does.
1996 For example:</p></div>
1997 <div class="listingblock">
1998 <div class="content">
1999 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
2000 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2001 4da45be
2002 7134973 -- NO NEWLINE
2004 $ git log -2 --pretty=tformat:%h 4da45bef \
2005 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
2006 4da45be
2007 7134973</tt></pre>
2008 </div></div>
2009 <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
2010 as if it has <tt>tformat:</tt> in front of it. For example, these two are
2011 equivalent:</p></div>
2012 <div class="listingblock">
2013 <div class="content">
2014 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
2015 $ git log -2 --pretty=%h 4da45bef</tt></pre>
2016 </div></div>
2017 </li>
2018 </ul></div>
2019 </div>
2020 <h2 id="_common_diff_options">Common diff options</h2>
2021 <div class="sectionbody">
2022 <div class="dlist"><dl>
2023 <dt class="hdlist1">
2025 </dt>
2026 <dt class="hdlist1">
2028 </dt>
2029 <dt class="hdlist1">
2030 --patch
2031 </dt>
2032 <dd>
2034 Generate patch (see section on generating patches).
2036 </p>
2037 </dd>
2038 <dt class="hdlist1">
2039 -U&lt;n&gt;
2040 </dt>
2041 <dt class="hdlist1">
2042 --unified=&lt;n&gt;
2043 </dt>
2044 <dd>
2046 Generate diffs with &lt;n&gt; lines of context instead of
2047 the usual three.
2048 Implies <tt>-p</tt>.
2049 </p>
2050 </dd>
2051 <dt class="hdlist1">
2052 --raw
2053 </dt>
2054 <dd>
2056 Generate the raw format.
2058 </p>
2059 </dd>
2060 <dt class="hdlist1">
2061 --patch-with-raw
2062 </dt>
2063 <dd>
2065 Synonym for <tt>-p --raw</tt>.
2066 </p>
2067 </dd>
2068 <dt class="hdlist1">
2069 --patience
2070 </dt>
2071 <dd>
2073 Generate a diff using the "patience diff" algorithm.
2074 </p>
2075 </dd>
2076 <dt class="hdlist1">
2077 --stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
2078 </dt>
2079 <dd>
2081 Generate a diffstat. You can override the default
2082 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
2083 The width of the filename part can be controlled by
2084 giving another width to it separated by a comma.
2085 By giving a third parameter <tt>&lt;count&gt;</tt>, you can limit the
2086 output to the first <tt>&lt;count&gt;</tt> lines, followed by
2087 <tt>&#8230;</tt> if there are more.
2088 </p>
2089 <div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=&lt;width&gt;</tt>,
2090 <tt>--stat-name-width=&lt;name-width&gt;</tt> and <tt>--stat-count=&lt;count&gt;</tt>.</p></div>
2091 </dd>
2092 <dt class="hdlist1">
2093 --numstat
2094 </dt>
2095 <dd>
2097 Similar to <tt>--stat</tt>, but shows number of added and
2098 deleted lines in decimal notation and pathname without
2099 abbreviation, to make it more machine friendly. For
2100 binary files, outputs two <tt>-</tt> instead of saying
2101 <tt>0 0</tt>.
2102 </p>
2103 </dd>
2104 <dt class="hdlist1">
2105 --shortstat
2106 </dt>
2107 <dd>
2109 Output only the last line of the <tt>--stat</tt> format containing total
2110 number of modified files, as well as number of added and deleted
2111 lines.
2112 </p>
2113 </dd>
2114 <dt class="hdlist1">
2115 --dirstat[=&lt;param1,param2,&#8230;&gt;]
2116 </dt>
2117 <dd>
2119 Output the distribution of relative amount of changes for each
2120 sub-directory. The behavior of <tt>--dirstat</tt> can be customized by
2121 passing it a comma separated list of parameters.
2122 The defaults are controlled by the <tt>diff.dirstat</tt> configuration
2123 variable (see <a href="git-config.html">git-config(1)</a>).
2124 The following parameters are available:
2125 </p>
2126 <div class="dlist"><dl>
2127 <dt class="hdlist1">
2128 <tt>changes</tt>
2129 </dt>
2130 <dd>
2132 Compute the dirstat numbers by counting the lines that have been
2133 removed from the source, or added to the destination. This ignores
2134 the amount of pure code movements within a file. In other words,
2135 rearranging lines in a file is not counted as much as other changes.
2136 This is the default behavior when no parameter is given.
2137 </p>
2138 </dd>
2139 <dt class="hdlist1">
2140 <tt>lines</tt>
2141 </dt>
2142 <dd>
2144 Compute the dirstat numbers by doing the regular line-based diff
2145 analysis, and summing the removed/added line counts. (For binary
2146 files, count 64-byte chunks instead, since binary files have no
2147 natural concept of lines). This is a more expensive <tt>--dirstat</tt>
2148 behavior than the <tt>changes</tt> behavior, but it does count rearranged
2149 lines within a file as much as other changes. The resulting output
2150 is consistent with what you get from the other <tt>--*stat</tt> options.
2151 </p>
2152 </dd>
2153 <dt class="hdlist1">
2154 <tt>files</tt>
2155 </dt>
2156 <dd>
2158 Compute the dirstat numbers by counting the number of files changed.
2159 Each changed file counts equally in the dirstat analysis. This is
2160 the computationally cheapest <tt>--dirstat</tt> behavior, since it does
2161 not have to look at the file contents at all.
2162 </p>
2163 </dd>
2164 <dt class="hdlist1">
2165 <tt>cumulative</tt>
2166 </dt>
2167 <dd>
2169 Count changes in a child directory for the parent directory as well.
2170 Note that when using <tt>cumulative</tt>, the sum of the percentages
2171 reported may exceed 100%. The default (non-cumulative) behavior can
2172 be specified with the <tt>noncumulative</tt> parameter.
2173 </p>
2174 </dd>
2175 <dt class="hdlist1">
2176 &lt;limit&gt;
2177 </dt>
2178 <dd>
2180 An integer parameter specifies a cut-off percent (3% by default).
2181 Directories contributing less than this percentage of the changes
2182 are not shown in the output.
2183 </p>
2184 </dd>
2185 </dl></div>
2186 <div class="paragraph"><p>Example: The following will count changed files, while ignoring
2187 directories with less than 10% of the total amount of changed files,
2188 and accumulating child directory counts in the parent directories:
2189 <tt>--dirstat=files,10,cumulative</tt>.</p></div>
2190 </dd>
2191 <dt class="hdlist1">
2192 --summary
2193 </dt>
2194 <dd>
2196 Output a condensed summary of extended header information
2197 such as creations, renames and mode changes.
2198 </p>
2199 </dd>
2200 <dt class="hdlist1">
2201 --patch-with-stat
2202 </dt>
2203 <dd>
2205 Synonym for <tt>-p --stat</tt>.
2206 </p>
2207 </dd>
2208 <dt class="hdlist1">
2210 </dt>
2211 <dd>
2213 Separate the commits with NULs instead of with new newlines.
2214 </p>
2215 <div class="paragraph"><p>Also, when <tt>--raw</tt> or <tt>--numstat</tt> has been given, do not munge
2216 pathnames and use NULs as output field terminators.</p></div>
2217 <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
2218 and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
2219 respectively, and the pathname will be enclosed in double quotes if
2220 any of those replacements occurred.</p></div>
2221 </dd>
2222 <dt class="hdlist1">
2223 --name-only
2224 </dt>
2225 <dd>
2227 Show only names of changed files.
2228 </p>
2229 </dd>
2230 <dt class="hdlist1">
2231 --name-status
2232 </dt>
2233 <dd>
2235 Show only names and status of changed files. See the description
2236 of the <tt>--diff-filter</tt> option on what the status letters mean.
2237 </p>
2238 </dd>
2239 <dt class="hdlist1">
2240 --submodule[=&lt;format&gt;]
2241 </dt>
2242 <dd>
2244 Chose the output format for submodule differences. &lt;format&gt; can be one of
2245 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
2246 is used when this option is not given. <em>log</em> is the default value for this
2247 option and lists the commits in that commit range like the <em>summary</em>
2248 option of <a href="git-submodule.html">git-submodule(1)</a> does.
2249 </p>
2250 </dd>
2251 <dt class="hdlist1">
2252 --color[=&lt;when&gt;]
2253 </dt>
2254 <dd>
2256 Show colored diff.
2257 The value must be <tt>always</tt> (the default for <tt>&lt;when&gt;</tt>), <tt>never</tt>, or <tt>auto</tt>.
2258 The default value is <tt>never</tt>.
2259 </p>
2260 </dd>
2261 <dt class="hdlist1">
2262 --no-color
2263 </dt>
2264 <dd>
2266 Turn off colored diff.
2267 It is the same as <tt>--color=never</tt>.
2268 </p>
2269 </dd>
2270 <dt class="hdlist1">
2271 --word-diff[=&lt;mode&gt;]
2272 </dt>
2273 <dd>
2275 Show a word diff, using the &lt;mode&gt; to delimit changed words.
2276 By default, words are delimited by whitespace; see
2277 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
2278 must be one of:
2279 </p>
2280 <div class="dlist"><dl>
2281 <dt class="hdlist1">
2282 color
2283 </dt>
2284 <dd>
2286 Highlight changed words using only colors. Implies <tt>--color</tt>.
2287 </p>
2288 </dd>
2289 <dt class="hdlist1">
2290 plain
2291 </dt>
2292 <dd>
2294 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
2295 attempts to escape the delimiters if they appear in the input,
2296 so the output may be ambiguous.
2297 </p>
2298 </dd>
2299 <dt class="hdlist1">
2300 porcelain
2301 </dt>
2302 <dd>
2304 Use a special line-based format intended for script
2305 consumption. Added/removed/unchanged runs are printed in the
2306 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
2307 character at the beginning of the line and extending to the
2308 end of the line. Newlines in the input are represented by a
2309 tilde <tt>~</tt> on a line of its own.
2310 </p>
2311 </dd>
2312 <dt class="hdlist1">
2313 none
2314 </dt>
2315 <dd>
2317 Disable word diff again.
2318 </p>
2319 </dd>
2320 </dl></div>
2321 <div class="paragraph"><p>Note that despite the name of the first mode, color is used to
2322 highlight the changed parts in all modes if enabled.</p></div>
2323 </dd>
2324 <dt class="hdlist1">
2325 --word-diff-regex=&lt;regex&gt;
2326 </dt>
2327 <dd>
2329 Use &lt;regex&gt; to decide what a word is, instead of considering
2330 runs of non-whitespace to be a word. Also implies
2331 <tt>--word-diff</tt> unless it was already enabled.
2332 </p>
2333 <div class="paragraph"><p>Every non-overlapping match of the
2334 &lt;regex&gt; is considered a word. Anything between these matches is
2335 considered whitespace and ignored(!) for the purposes of finding
2336 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
2337 expression to make sure that it matches all non-whitespace characters.
2338 A match that contains a newline is silently truncated(!) at the
2339 newline.</p></div>
2340 <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
2341 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
2342 overrides any diff driver or configuration setting. Diff drivers
2343 override configuration settings.</p></div>
2344 </dd>
2345 <dt class="hdlist1">
2346 --color-words[=&lt;regex&gt;]
2347 </dt>
2348 <dd>
2350 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
2351 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
2352 </p>
2353 </dd>
2354 <dt class="hdlist1">
2355 --no-renames
2356 </dt>
2357 <dd>
2359 Turn off rename detection, even when the configuration
2360 file gives the default to do so.
2361 </p>
2362 </dd>
2363 <dt class="hdlist1">
2364 --check
2365 </dt>
2366 <dd>
2368 Warn if changes introduce whitespace errors. What are
2369 considered whitespace errors is controlled by <tt>core.whitespace</tt>
2370 configuration. By default, trailing whitespaces (including
2371 lines that solely consist of whitespaces) and a space character
2372 that is immediately followed by a tab character inside the
2373 initial indent of the line are considered whitespace errors.
2374 Exits with non-zero status if problems are found. Not compatible
2375 with --exit-code.
2376 </p>
2377 </dd>
2378 <dt class="hdlist1">
2379 --full-index
2380 </dt>
2381 <dd>
2383 Instead of the first handful of characters, show the full
2384 pre- and post-image blob object names on the "index"
2385 line when generating patch format output.
2386 </p>
2387 </dd>
2388 <dt class="hdlist1">
2389 --binary
2390 </dt>
2391 <dd>
2393 In addition to <tt>--full-index</tt>, output a binary diff that
2394 can be applied with <tt>git-apply</tt>.
2395 </p>
2396 </dd>
2397 <dt class="hdlist1">
2398 --abbrev[=&lt;n&gt;]
2399 </dt>
2400 <dd>
2402 Instead of showing the full 40-byte hexadecimal object
2403 name in diff-raw format output and diff-tree header
2404 lines, show only a partial prefix. This is
2405 independent of the <tt>--full-index</tt> option above, which controls
2406 the diff-patch output format. Non default number of
2407 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
2408 </p>
2409 </dd>
2410 <dt class="hdlist1">
2411 -B[&lt;n&gt;][/&lt;m&gt;]
2412 </dt>
2413 <dt class="hdlist1">
2414 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
2415 </dt>
2416 <dd>
2418 Break complete rewrite changes into pairs of delete and
2419 create. This serves two purposes:
2420 </p>
2421 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
2422 not as a series of deletion and insertion mixed together with a very
2423 few lines that happen to match textually as the context, but as a
2424 single deletion of everything old followed by a single insertion of
2425 everything new, and the number <tt>m</tt> controls this aspect of the -B
2426 option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
2427 original should remain in the result for git to consider it a total
2428 rewrite (i.e. otherwise the resulting patch will be a series of
2429 deletion and insertion mixed together with context lines).</p></div>
2430 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
2431 source of a rename (usually -M only considers a file that disappeared
2432 as the source of a rename), and the number <tt>n</tt> controls this aspect of
2433 the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
2434 addition and deletion compared to 20% or more of the file&#8217;s size are
2435 eligible for being picked up as a possible source of a rename to
2436 another file.</p></div>
2437 </dd>
2438 <dt class="hdlist1">
2439 -M[&lt;n&gt;]
2440 </dt>
2441 <dt class="hdlist1">
2442 --find-renames[=&lt;n&gt;]
2443 </dt>
2444 <dd>
2446 If generating diffs, detect and report renames for each commit.
2447 For following files across renames while traversing history, see
2448 <tt>--follow</tt>.
2449 If <tt>n</tt> is specified, it is a threshold on the similarity
2450 index (i.e. amount of addition/deletions compared to the
2451 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
2452 delete/add pair to be a rename if more than 90% of the file
2453 hasn&#8217;t changed.
2454 </p>
2455 </dd>
2456 <dt class="hdlist1">
2457 -C[&lt;n&gt;]
2458 </dt>
2459 <dt class="hdlist1">
2460 --find-copies[=&lt;n&gt;]
2461 </dt>
2462 <dd>
2464 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
2465 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
2466 </p>
2467 </dd>
2468 <dt class="hdlist1">
2469 --find-copies-harder
2470 </dt>
2471 <dd>
2473 For performance reasons, by default, <tt>-C</tt> option finds copies only
2474 if the original file of the copy was modified in the same
2475 changeset. This flag makes the command
2476 inspect unmodified files as candidates for the source of
2477 copy. This is a very expensive operation for large
2478 projects, so use it with caution. Giving more than one
2479 <tt>-C</tt> option has the same effect.
2480 </p>
2481 </dd>
2482 <dt class="hdlist1">
2484 </dt>
2485 <dt class="hdlist1">
2486 --irreversible-delete
2487 </dt>
2488 <dd>
2490 Omit the preimage for deletes, i.e. print only the header but not
2491 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
2492 is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is
2493 solely for people who want to just concentrate on reviewing the
2494 text after the change. In addition, the output obviously lack
2495 enough information to apply such a patch in reverse, even manually,
2496 hence the name of the option.
2497 </p>
2498 <div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
2499 of a delete/create pair.</p></div>
2500 </dd>
2501 <dt class="hdlist1">
2502 -l&lt;num&gt;
2503 </dt>
2504 <dd>
2506 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
2507 is the number of potential rename/copy targets. This
2508 option prevents rename/copy detection from running if
2509 the number of rename/copy targets exceeds the specified
2510 number.
2511 </p>
2512 </dd>
2513 <dt class="hdlist1">
2514 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
2515 </dt>
2516 <dd>
2518 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
2519 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
2520 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
2521 are Unmerged (<tt>U</tt>), are
2522 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
2523 Any combination of the filter characters (including none) can be used.
2524 When <tt>*</tt> (All-or-none) is added to the combination, all
2525 paths are selected if there is any file that matches
2526 other criteria in the comparison; if there is no file
2527 that matches other criteria, nothing is selected.
2528 </p>
2529 </dd>
2530 <dt class="hdlist1">
2531 -S&lt;string&gt;
2532 </dt>
2533 <dd>
2535 Look for differences that introduce or remove an instance of
2536 &lt;string&gt;. Note that this is different than the string simply
2537 appearing in diff output; see the <em>pickaxe</em> entry in
2538 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
2539 </p>
2540 </dd>
2541 <dt class="hdlist1">
2542 -G&lt;regex&gt;
2543 </dt>
2544 <dd>
2546 Look for differences whose added or removed line matches
2547 the given &lt;regex&gt;.
2548 </p>
2549 </dd>
2550 <dt class="hdlist1">
2551 --pickaxe-all
2552 </dt>
2553 <dd>
2555 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
2556 changeset, not just the files that contain the change
2557 in &lt;string&gt;.
2558 </p>
2559 </dd>
2560 <dt class="hdlist1">
2561 --pickaxe-regex
2562 </dt>
2563 <dd>
2565 Make the &lt;string&gt; not a plain string but an extended POSIX
2566 regex to match.
2567 </p>
2568 </dd>
2569 <dt class="hdlist1">
2570 -O&lt;orderfile&gt;
2571 </dt>
2572 <dd>
2574 Output the patch in the order specified in the
2575 &lt;orderfile&gt;, which has one shell glob pattern per line.
2576 </p>
2577 </dd>
2578 <dt class="hdlist1">
2580 </dt>
2581 <dd>
2583 Swap two inputs; that is, show differences from index or
2584 on-disk file to tree contents.
2585 </p>
2586 </dd>
2587 <dt class="hdlist1">
2588 --relative[=&lt;path&gt;]
2589 </dt>
2590 <dd>
2592 When run from a subdirectory of the project, it can be
2593 told to exclude changes outside the directory and show
2594 pathnames relative to it with this option. When you are
2595 not in a subdirectory (e.g. in a bare repository), you
2596 can name which subdirectory to make the output relative
2597 to by giving a &lt;path&gt; as an argument.
2598 </p>
2599 </dd>
2600 <dt class="hdlist1">
2602 </dt>
2603 <dt class="hdlist1">
2604 --text
2605 </dt>
2606 <dd>
2608 Treat all files as text.
2609 </p>
2610 </dd>
2611 <dt class="hdlist1">
2612 --ignore-space-at-eol
2613 </dt>
2614 <dd>
2616 Ignore changes in whitespace at EOL.
2617 </p>
2618 </dd>
2619 <dt class="hdlist1">
2621 </dt>
2622 <dt class="hdlist1">
2623 --ignore-space-change
2624 </dt>
2625 <dd>
2627 Ignore changes in amount of whitespace. This ignores whitespace
2628 at line end, and considers all other sequences of one or
2629 more whitespace characters to be equivalent.
2630 </p>
2631 </dd>
2632 <dt class="hdlist1">
2634 </dt>
2635 <dt class="hdlist1">
2636 --ignore-all-space
2637 </dt>
2638 <dd>
2640 Ignore whitespace when comparing lines. This ignores
2641 differences even if one line has whitespace where the other
2642 line has none.
2643 </p>
2644 </dd>
2645 <dt class="hdlist1">
2646 --inter-hunk-context=&lt;lines&gt;
2647 </dt>
2648 <dd>
2650 Show the context between diff hunks, up to the specified number
2651 of lines, thereby fusing hunks that are close to each other.
2652 </p>
2653 </dd>
2654 <dt class="hdlist1">
2655 --exit-code
2656 </dt>
2657 <dd>
2659 Make the program exit with codes similar to diff(1).
2660 That is, it exits with 1 if there were differences and
2661 0 means no differences.
2662 </p>
2663 </dd>
2664 <dt class="hdlist1">
2665 --quiet
2666 </dt>
2667 <dd>
2669 Disable all output of the program. Implies <tt>--exit-code</tt>.
2670 </p>
2671 </dd>
2672 <dt class="hdlist1">
2673 --ext-diff
2674 </dt>
2675 <dd>
2677 Allow an external diff helper to be executed. If you set an
2678 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
2679 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
2680 </p>
2681 </dd>
2682 <dt class="hdlist1">
2683 --no-ext-diff
2684 </dt>
2685 <dd>
2687 Disallow external diff drivers.
2688 </p>
2689 </dd>
2690 <dt class="hdlist1">
2691 --textconv
2692 </dt>
2693 <dt class="hdlist1">
2694 --no-textconv
2695 </dt>
2696 <dd>
2698 Allow (or disallow) external text conversion filters to be run
2699 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
2700 details. Because textconv filters are typically a one-way
2701 conversion, the resulting diff is suitable for human
2702 consumption, but cannot be applied. For this reason, textconv
2703 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
2704 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
2705 diff plumbing commands.
2706 </p>
2707 </dd>
2708 <dt class="hdlist1">
2709 --ignore-submodules[=&lt;when&gt;]
2710 </dt>
2711 <dd>
2713 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
2714 either "none", "untracked", "dirty" or "all", which is the default
2715 Using "none" will consider the submodule modified when it either contains
2716 untracked or modified files or its HEAD differs from the commit recorded
2717 in the superproject and can be used to override any settings of the
2718 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
2719 "untracked" is used submodules are not considered dirty when they only
2720 contain untracked content (but they are still scanned for modified
2721 content). Using "dirty" ignores all changes to the work tree of submodules,
2722 only changes to the commits stored in the superproject are shown (this was
2723 the behavior until 1.7.0). Using "all" hides all changes to submodules.
2724 </p>
2725 </dd>
2726 <dt class="hdlist1">
2727 --src-prefix=&lt;prefix&gt;
2728 </dt>
2729 <dd>
2731 Show the given source prefix instead of "a/".
2732 </p>
2733 </dd>
2734 <dt class="hdlist1">
2735 --dst-prefix=&lt;prefix&gt;
2736 </dt>
2737 <dd>
2739 Show the given destination prefix instead of "b/".
2740 </p>
2741 </dd>
2742 <dt class="hdlist1">
2743 --no-prefix
2744 </dt>
2745 <dd>
2747 Do not show any source or destination prefix.
2748 </p>
2749 </dd>
2750 </dl></div>
2751 <div class="paragraph"><p>For more detailed explanation on these common options, see also
2752 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
2753 </div>
2754 <h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2755 <div class="sectionbody">
2756 <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2757 with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2758 "git log" with the "-p" option, they
2759 do not produce the output described above; instead they produce a
2760 patch file. You can customize the creation of such patches via the
2761 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2762 <div class="paragraph"><p>What the -p option produces is slightly different from the traditional
2763 diff format:</p></div>
2764 <div class="olist arabic"><ol class="arabic">
2765 <li>
2767 It is preceded with a "git diff" header that looks like this:
2768 </p>
2769 <div class="literalblock">
2770 <div class="content">
2771 <pre><tt>diff --git a/file1 b/file2</tt></pre>
2772 </div></div>
2773 <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
2774 involved. Especially, even for a creation or a deletion,
2775 <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2776 <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
2777 name of the source file of the rename/copy and the name of
2778 the file that rename/copy produces, respectively.</p></div>
2779 </li>
2780 <li>
2782 It is followed by one or more extended header lines:
2783 </p>
2784 <div class="literalblock">
2785 <div class="content">
2786 <pre><tt>old mode &lt;mode&gt;
2787 new mode &lt;mode&gt;
2788 deleted file mode &lt;mode&gt;
2789 new file mode &lt;mode&gt;
2790 copy from &lt;path&gt;
2791 copy to &lt;path&gt;
2792 rename from &lt;path&gt;
2793 rename to &lt;path&gt;
2794 similarity index &lt;number&gt;
2795 dissimilarity index &lt;number&gt;
2796 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2797 </div></div>
2798 <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
2799 and file permission bits.</p></div>
2800 <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
2801 <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
2802 the dissimilarity index is the percentage of changed lines. It
2803 is a rounded down integer, followed by a percent sign. The
2804 similarity index value of 100% is thus reserved for two equal
2805 files, while 100% dissimilarity means that no line from the old
2806 file made it into the new one.</p></div>
2807 <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
2808 The &lt;mode&gt; is included if the file mode does not change; otherwise,
2809 separate lines indicate the old and the new mode.</p></div>
2810 </li>
2811 <li>
2813 TAB, LF, double quote and backslash characters in pathnames
2814 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2815 If there is need for such substitution then the whole
2816 pathname is put in double quotes.
2817 </p>
2818 </li>
2819 <li>
2821 All the <tt>file1</tt> files in the output refer to files before the
2822 commit, and all the <tt>file2</tt> files refer to files after the commit.
2823 It is incorrect to apply each change to each file sequentially. For
2824 example, this patch will swap a and b:
2825 </p>
2826 <div class="literalblock">
2827 <div class="content">
2828 <pre><tt>diff --git a/a b/b
2829 rename from a
2830 rename to b
2831 diff --git a/b b/a
2832 rename from b
2833 rename to a</tt></pre>
2834 </div></div>
2835 </li>
2836 </ol></div>
2837 </div>
2838 <h2 id="_combined_diff_format">combined diff format</h2>
2839 <div class="sectionbody">
2840 <div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
2841 produce a <em>combined diff</em> when showing a merge. This is the default
2842 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2843 <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
2844 of these commands to force generation of diffs with individual parents
2845 of a merge.</p></div>
2846 <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
2847 <div class="listingblock">
2848 <div class="content">
2849 <pre><tt>diff --combined describe.c
2850 index fabadb8,cc95eb0..4866510
2851 --- a/describe.c
2852 +++ b/describe.c
2853 @@@ -98,20 -98,12 +98,20 @@@
2854 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2857 - static void describe(char *arg)
2858 -static void describe(struct commit *cmit, int last_one)
2859 ++static void describe(char *arg, int last_one)
2861 + unsigned char sha1[20];
2862 + struct commit *cmit;
2863 struct commit_list *list;
2864 static int initialized = 0;
2865 struct commit_name *n;
2867 + if (get_sha1(arg, sha1) &lt; 0)
2868 + usage(describe_usage);
2869 + cmit = lookup_commit_reference(sha1);
2870 + if (!cmit)
2871 + usage(describe_usage);
2873 if (!initialized) {
2874 initialized = 1;
2875 for_each_ref(get_name);</tt></pre>
2876 </div></div>
2877 <div class="olist arabic"><ol class="arabic">
2878 <li>
2880 It is preceded with a "git diff" header, that looks like
2881 this (when <em>-c</em> option is used):
2882 </p>
2883 <div class="literalblock">
2884 <div class="content">
2885 <pre><tt>diff --combined file</tt></pre>
2886 </div></div>
2887 <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
2888 <div class="literalblock">
2889 <div class="content">
2890 <pre><tt>diff --cc file</tt></pre>
2891 </div></div>
2892 </li>
2893 <li>
2895 It is followed by one or more extended header lines
2896 (this example shows a merge with two parents):
2897 </p>
2898 <div class="literalblock">
2899 <div class="content">
2900 <pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2901 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2902 new file mode &lt;mode&gt;
2903 deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
2904 </div></div>
2905 <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
2906 the &lt;mode&gt; is different from the rest. Extended headers with
2907 information about detected contents movement (renames and
2908 copying detection) are designed to work with diff of two
2909 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
2910 </li>
2911 <li>
2913 It is followed by two-line from-file/to-file header
2914 </p>
2915 <div class="literalblock">
2916 <div class="content">
2917 <pre><tt>--- a/file
2918 +++ b/file</tt></pre>
2919 </div></div>
2920 <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
2921 format, <tt>/dev/null</tt> is used to signal created or deleted
2922 files.</p></div>
2923 </li>
2924 <li>
2926 Chunk header format is modified to prevent people from
2927 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
2928 was created for review of merge commit changes, and was not
2929 meant for apply. The change is similar to the change in the
2930 extended <em>index</em> header:
2931 </p>
2932 <div class="literalblock">
2933 <div class="content">
2934 <pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
2935 </div></div>
2936 <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
2937 header for combined diff format.</p></div>
2938 </li>
2939 </ol></div>
2940 <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
2941 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
2942 added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
2943 compares two or more files file1, file2,&#8230; with one file X, and
2944 shows how X differs from each of fileN. One column for each of
2945 fileN is prepended to the output line to note how X&#8217;s line is
2946 different from it.</p></div>
2947 <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
2948 fileN but it does not appear in the result. A <tt>+</tt> character
2949 in the column N means that the line appears in the result,
2950 and fileN does not have that line (in other words, the line was
2951 added, from the point of view of that parent).</p></div>
2952 <div class="paragraph"><p>In the above example output, the function signature was changed
2953 from both files (hence two <tt>-</tt> removals from both file1 and
2954 file2, plus <tt>++</tt> to mean one line that was added does not appear
2955 in either file1 nor file2). Also eight other lines are the same
2956 from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
2957 <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
2958 merge commit with the merge result (i.e. file1..fileN are the
2959 parents). When shown by <tt>git diff-files -c</tt>, it compares the
2960 two unresolved merge parents with the working tree file
2961 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2962 "their version").</p></div>
2963 </div>
2964 <h2 id="_examples">Examples</h2>
2965 <div class="sectionbody">
2966 <div class="dlist"><dl>
2967 <dt class="hdlist1">
2968 <tt>git log --no-merges</tt>
2969 </dt>
2970 <dd>
2972 Show the whole commit history, but skip any merges
2973 </p>
2974 </dd>
2975 <dt class="hdlist1">
2976 <tt>git log v2.6.12.. include/scsi drivers/scsi</tt>
2977 </dt>
2978 <dd>
2980 Show all commits since version <em>v2.6.12</em> that changed any file
2981 in the include/scsi or drivers/scsi subdirectories
2982 </p>
2983 </dd>
2984 <dt class="hdlist1">
2985 <tt>git log --since="2 weeks ago" -- gitk</tt>
2986 </dt>
2987 <dd>
2989 Show the changes during the last two weeks to the file <em>gitk</em>.
2990 The "--" is necessary to avoid confusion with the <strong>branch</strong> named
2991 <em>gitk</em>
2992 </p>
2993 </dd>
2994 <dt class="hdlist1">
2995 <tt>git log --name-status release..test</tt>
2996 </dt>
2997 <dd>
2999 Show the commits that are in the "test" branch but not yet
3000 in the "release" branch, along with the list of paths
3001 each commit modifies.
3002 </p>
3003 </dd>
3004 <dt class="hdlist1">
3005 <tt>git log --follow builtin-rev-list.c</tt>
3006 </dt>
3007 <dd>
3009 Shows the commits that changed builtin-rev-list.c, including
3010 those commits that occurred before the file was given its
3011 present name.
3012 </p>
3013 </dd>
3014 <dt class="hdlist1">
3015 <tt>git log --branches --not --remotes=origin</tt>
3016 </dt>
3017 <dd>
3019 Shows all commits that are in any of local branches but not in
3020 any of remote-tracking branches for <em>origin</em> (what you have that
3021 origin doesn&#8217;t).
3022 </p>
3023 </dd>
3024 <dt class="hdlist1">
3025 <tt>git log master --not --remotes=*/master</tt>
3026 </dt>
3027 <dd>
3029 Shows all commits that are in local master but not in any remote
3030 repository master branches.
3031 </p>
3032 </dd>
3033 <dt class="hdlist1">
3034 <tt>git log -p -m --first-parent</tt>
3035 </dt>
3036 <dd>
3038 Shows the history including change diffs, but only from the
3039 "main branch" perspective, skipping commits that come from merged
3040 branches, and showing full diffs of changes introduced by the merges.
3041 This makes sense only when following a strict policy of merging all
3042 topic branches when staying on a single integration branch.
3043 </p>
3044 </dd>
3045 </dl></div>
3046 </div>
3047 <h2 id="_discussion">Discussion</h2>
3048 <div class="sectionbody">
3049 <div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div>
3050 <div class="ulist"><ul>
3051 <li>
3053 The pathnames recorded in the index and in the tree objects
3054 are treated as uninterpreted sequences of non-NUL bytes.
3055 What readdir(2) returns are what are recorded and compared
3056 with the data git keeps track of, which in turn are expected
3057 to be what lstat(2) and creat(2) accepts. There is no such
3058 thing as pathname encoding translation.
3059 </p>
3060 </li>
3061 <li>
3063 The contents of the blob objects are uninterpreted sequences
3064 of bytes. There is no encoding translation at the core
3065 level.
3066 </p>
3067 </li>
3068 <li>
3070 The commit log messages are uninterpreted sequences of non-NUL
3071 bytes.
3072 </p>
3073 </li>
3074 </ul></div>
3075 <div class="paragraph"><p>Although we encourage that the commit log messages are encoded
3076 in UTF-8, both the core and git Porcelain are designed not to
3077 force UTF-8 on projects. If all participants of a particular
3078 project find it more convenient to use legacy encodings, git
3079 does not forbid it. However, there are a few things to keep in
3080 mind.</p></div>
3081 <div class="olist arabic"><ol class="arabic">
3082 <li>
3084 <em>git commit</em> and <em>git commit-tree</em> issues
3085 a warning if the commit log message given to it does not look
3086 like a valid UTF-8 string, unless you explicitly say your
3087 project uses a legacy encoding. The way to say this is to
3088 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
3089 </p>
3090 <div class="listingblock">
3091 <div class="content">
3092 <pre><tt>[i18n]
3093 commitencoding = ISO-8859-1</tt></pre>
3094 </div></div>
3095 <div class="paragraph"><p>Commit objects created with the above setting record the value
3096 of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
3097 help other people who look at them later. Lack of this header
3098 implies that the commit log message is encoded in UTF-8.</p></div>
3099 </li>
3100 <li>
3102 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
3103 <tt>encoding</tt> header of a commit object, and try to re-code the
3104 log message into UTF-8 unless otherwise specified. You can
3105 specify the desired output encoding with
3106 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
3107 </p>
3108 <div class="listingblock">
3109 <div class="content">
3110 <pre><tt>[i18n]
3111 logoutputencoding = ISO-8859-1</tt></pre>
3112 </div></div>
3113 <div class="paragraph"><p>If you do not have this configuration variable, the value of
3114 <tt>i18n.commitencoding</tt> is used instead.</p></div>
3115 </li>
3116 </ol></div>
3117 <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
3118 message when a commit is made to force UTF-8 at the commit
3119 object level, because re-coding to UTF-8 is not necessarily a
3120 reversible operation.</p></div>
3121 </div>
3122 <h2 id="_configuration">Configuration</h2>
3123 <div class="sectionbody">
3124 <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>
3125 for settings related to diff generation.</p></div>
3126 <div class="dlist"><dl>
3127 <dt class="hdlist1">
3128 format.pretty
3129 </dt>
3130 <dd>
3132 Default for the <tt>--format</tt> option. (See "PRETTY FORMATS" above.)
3133 Defaults to "medium".
3134 </p>
3135 </dd>
3136 <dt class="hdlist1">
3137 i18n.logOutputEncoding
3138 </dt>
3139 <dd>
3141 Encoding to use when displaying logs. (See "Discussion", above.)
3142 Defaults to the value of <tt>i18n.commitEncoding</tt> if set, UTF-8
3143 otherwise.
3144 </p>
3145 </dd>
3146 <dt class="hdlist1">
3147 log.date
3148 </dt>
3149 <dd>
3151 Default format for human-readable dates. (Compare the
3152 <tt>--date</tt> option.) Defaults to "default", which means to write
3153 dates like <tt>Sat May 8 19:35:34 2010 -0500</tt>.
3154 </p>
3155 </dd>
3156 <dt class="hdlist1">
3157 log.showroot
3158 </dt>
3159 <dd>
3161 If <tt>false</tt>, <em>git log</em> and related commands will not treat the
3162 initial commit as a big creation event. Any root commits in
3163 <tt>git log -p</tt> output would be shown without a diff attached.
3164 The default is <tt>true</tt>.
3165 </p>
3166 </dd>
3167 <dt class="hdlist1">
3168 mailmap.file
3169 </dt>
3170 <dd>
3172 See <a href="git-shortlog.html">git-shortlog(1)</a>.
3173 </p>
3174 </dd>
3175 <dt class="hdlist1">
3176 notes.displayRef
3177 </dt>
3178 <dd>
3180 Which refs, in addition to the default set by <tt>core.notesRef</tt>
3181 or <em>GIT_NOTES_REF</em>, to read notes from when showing commit
3182 messages with the <em>log</em> family of commands. See
3183 <a href="git-notes.html">git-notes(1)</a>.
3184 </p>
3185 <div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified
3186 multiple times. A warning will be issued for refs that do not exist,
3187 but a glob that does not match any refs is silently ignored.</p></div>
3188 <div class="paragraph"><p>This setting can be disabled by the <tt>--no-notes</tt> option,
3189 overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable,
3190 and overridden by the <tt>--notes=&lt;ref&gt;</tt> option.</p></div>
3191 </dd>
3192 </dl></div>
3193 </div>
3194 <h2 id="_git">GIT</h2>
3195 <div class="sectionbody">
3196 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
3197 </div>
3198 <div id="footer">
3199 <div id="footer-text">
3200 Last updated 2011-08-05 00:04:52 UTC
3201 </div>
3202 </div>
3203 </body>
3204 </html>