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