Autogenerated HTML docs for v1.7.5-185-g0b9dee
[git/jnareb-git.git] / git-diff-tree.html
blobd60485262d55438475f2d230d8fd7bcafc60aedc
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-diff-tree(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-diff-tree(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-diff-tree -
411 Compares the content and mode of blobs found via two tree objects
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
419 [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]
420 &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</div>
421 <div class="verseblock-attribution">
422 </div></div>
423 </div>
424 <h2 id="_description">DESCRIPTION</h2>
425 <div class="sectionbody">
426 <div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div>
427 <div class="paragraph"><p>If there is only one &lt;tree-ish&gt; given, the commit is compared with its parents
428 (see --stdin below).</p></div>
429 <div class="paragraph"><p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p></div>
430 </div>
431 <h2 id="_options">OPTIONS</h2>
432 <div class="sectionbody">
433 <div class="dlist"><dl>
434 <dt class="hdlist1">
436 </dt>
437 <dt class="hdlist1">
439 </dt>
440 <dt class="hdlist1">
441 --patch
442 </dt>
443 <dd>
445 Generate patch (see section on generating patches).
447 </p>
448 </dd>
449 <dt class="hdlist1">
450 -U&lt;n&gt;
451 </dt>
452 <dt class="hdlist1">
453 --unified=&lt;n&gt;
454 </dt>
455 <dd>
457 Generate diffs with &lt;n&gt; lines of context instead of
458 the usual three.
459 Implies <tt>-p</tt>.
460 </p>
461 </dd>
462 <dt class="hdlist1">
463 --raw
464 </dt>
465 <dd>
467 Generate the raw format.
468 This is the default.
469 </p>
470 </dd>
471 <dt class="hdlist1">
472 --patch-with-raw
473 </dt>
474 <dd>
476 Synonym for <tt>-p --raw</tt>.
477 </p>
478 </dd>
479 <dt class="hdlist1">
480 --patience
481 </dt>
482 <dd>
484 Generate a diff using the "patience diff" algorithm.
485 </p>
486 </dd>
487 <dt class="hdlist1">
488 --stat[=&lt;width&gt;[,&lt;name-width&gt;]]
489 </dt>
490 <dd>
492 Generate a diffstat. You can override the default
493 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
494 The width of the filename part can be controlled by
495 giving another width to it separated by a comma.
496 </p>
497 </dd>
498 <dt class="hdlist1">
499 --numstat
500 </dt>
501 <dd>
503 Similar to <tt>--stat</tt>, but shows number of added and
504 deleted lines in decimal notation and pathname without
505 abbreviation, to make it more machine friendly. For
506 binary files, outputs two <tt>-</tt> instead of saying
507 <tt>0 0</tt>.
508 </p>
509 </dd>
510 <dt class="hdlist1">
511 --shortstat
512 </dt>
513 <dd>
515 Output only the last line of the <tt>--stat</tt> format containing total
516 number of modified files, as well as number of added and deleted
517 lines.
518 </p>
519 </dd>
520 <dt class="hdlist1">
521 --dirstat[=&lt;limit&gt;]
522 </dt>
523 <dd>
525 Output the distribution of relative amount of changes (number of lines added or
526 removed) for each sub-directory. Directories with changes below
527 a cut-off percent (3% by default) are not shown. The cut-off percent
528 can be set with <tt>--dirstat=&lt;limit&gt;</tt>. Changes in a child directory are not
529 counted for the parent directory, unless <tt>--cumulative</tt> is used.
530 </p>
531 <div class="paragraph"><p>Note that the <tt>--dirstat</tt> option computes the changes while ignoring
532 the amount of pure code movements within a file. In other words,
533 rearranging lines in a file is not counted as much as other changes.</p></div>
534 </dd>
535 <dt class="hdlist1">
536 --dirstat-by-file[=&lt;limit&gt;]
537 </dt>
538 <dd>
540 Same as <tt>--dirstat</tt>, but counts changed files instead of lines.
541 </p>
542 </dd>
543 <dt class="hdlist1">
544 --summary
545 </dt>
546 <dd>
548 Output a condensed summary of extended header information
549 such as creations, renames and mode changes.
550 </p>
551 </dd>
552 <dt class="hdlist1">
553 --patch-with-stat
554 </dt>
555 <dd>
557 Synonym for <tt>-p --stat</tt>.
558 </p>
559 </dd>
560 <dt class="hdlist1">
562 </dt>
563 <dd>
565 When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been
566 given, do not munge pathnames and use NULs as output field terminators.
567 </p>
568 <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
569 and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
570 respectively, and the pathname will be enclosed in double quotes if
571 any of those replacements occurred.</p></div>
572 </dd>
573 <dt class="hdlist1">
574 --name-only
575 </dt>
576 <dd>
578 Show only names of changed files.
579 </p>
580 </dd>
581 <dt class="hdlist1">
582 --name-status
583 </dt>
584 <dd>
586 Show only names and status of changed files. See the description
587 of the <tt>--diff-filter</tt> option on what the status letters mean.
588 </p>
589 </dd>
590 <dt class="hdlist1">
591 --submodule[=&lt;format&gt;]
592 </dt>
593 <dd>
595 Chose the output format for submodule differences. &lt;format&gt; can be one of
596 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
597 is used when this option is not given. <em>log</em> is the default value for this
598 option and lists the commits in that commit range like the <em>summary</em>
599 option of <a href="git-submodule.html">git-submodule(1)</a> does.
600 </p>
601 </dd>
602 <dt class="hdlist1">
603 --color[=&lt;when&gt;]
604 </dt>
605 <dd>
607 Show colored diff.
608 The value must be always (the default), never, or auto.
609 </p>
610 </dd>
611 <dt class="hdlist1">
612 --no-color
613 </dt>
614 <dd>
616 Turn off colored diff, even when the configuration file
617 gives the default to color output.
618 Same as <tt>--color=never</tt>.
619 </p>
620 </dd>
621 <dt class="hdlist1">
622 --word-diff[=&lt;mode&gt;]
623 </dt>
624 <dd>
626 Show a word diff, using the &lt;mode&gt; to delimit changed words.
627 By default, words are delimited by whitespace; see
628 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
629 must be one of:
630 </p>
631 <div class="dlist"><dl>
632 <dt class="hdlist1">
633 color
634 </dt>
635 <dd>
637 Highlight changed words using only colors. Implies <tt>--color</tt>.
638 </p>
639 </dd>
640 <dt class="hdlist1">
641 plain
642 </dt>
643 <dd>
645 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
646 attempts to escape the delimiters if they appear in the input,
647 so the output may be ambiguous.
648 </p>
649 </dd>
650 <dt class="hdlist1">
651 porcelain
652 </dt>
653 <dd>
655 Use a special line-based format intended for script
656 consumption. Added/removed/unchanged runs are printed in the
657 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
658 character at the beginning of the line and extending to the
659 end of the line. Newlines in the input are represented by a
660 tilde <tt>~</tt> on a line of its own.
661 </p>
662 </dd>
663 <dt class="hdlist1">
664 none
665 </dt>
666 <dd>
668 Disable word diff again.
669 </p>
670 </dd>
671 </dl></div>
672 <div class="paragraph"><p>Note that despite the name of the first mode, color is used to
673 highlight the changed parts in all modes if enabled.</p></div>
674 </dd>
675 <dt class="hdlist1">
676 --word-diff-regex=&lt;regex&gt;
677 </dt>
678 <dd>
680 Use &lt;regex&gt; to decide what a word is, instead of considering
681 runs of non-whitespace to be a word. Also implies
682 <tt>--word-diff</tt> unless it was already enabled.
683 </p>
684 <div class="paragraph"><p>Every non-overlapping match of the
685 &lt;regex&gt; is considered a word. Anything between these matches is
686 considered whitespace and ignored(!) for the purposes of finding
687 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
688 expression to make sure that it matches all non-whitespace characters.
689 A match that contains a newline is silently truncated(!) at the
690 newline.</p></div>
691 <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
692 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
693 overrides any diff driver or configuration setting. Diff drivers
694 override configuration settings.</p></div>
695 </dd>
696 <dt class="hdlist1">
697 --color-words[=&lt;regex&gt;]
698 </dt>
699 <dd>
701 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
702 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
703 </p>
704 </dd>
705 <dt class="hdlist1">
706 --no-renames
707 </dt>
708 <dd>
710 Turn off rename detection, even when the configuration
711 file gives the default to do so.
712 </p>
713 </dd>
714 <dt class="hdlist1">
715 --check
716 </dt>
717 <dd>
719 Warn if changes introduce trailing whitespace
720 or an indent that uses a space before a tab. Exits with
721 non-zero status if problems are found. Not compatible with
722 --exit-code.
723 </p>
724 </dd>
725 <dt class="hdlist1">
726 --full-index
727 </dt>
728 <dd>
730 Instead of the first handful of characters, show the full
731 pre- and post-image blob object names on the "index"
732 line when generating patch format output.
733 </p>
734 </dd>
735 <dt class="hdlist1">
736 --binary
737 </dt>
738 <dd>
740 In addition to <tt>--full-index</tt>, output a binary diff that
741 can be applied with <tt>git-apply</tt>.
742 </p>
743 </dd>
744 <dt class="hdlist1">
745 --abbrev[=&lt;n&gt;]
746 </dt>
747 <dd>
749 Instead of showing the full 40-byte hexadecimal object
750 name in diff-raw format output and diff-tree header
751 lines, show only a partial prefix. This is
752 independent of the <tt>--full-index</tt> option above, which controls
753 the diff-patch output format. Non default number of
754 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
755 </p>
756 </dd>
757 <dt class="hdlist1">
758 -B[&lt;n&gt;][/&lt;m&gt;]
759 </dt>
760 <dt class="hdlist1">
761 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
762 </dt>
763 <dd>
765 Break complete rewrite changes into pairs of delete and
766 create. This serves two purposes:
767 </p>
768 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
769 not as a series of deletion and insertion mixed together with a very
770 few lines that happen to match textually as the context, but as a
771 single deletion of everything old followed by a single insertion of
772 everything new, and the number <tt>m</tt> controls this aspect of the -B
773 option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
774 original should remain in the result for git to consider it a total
775 rewrite (i.e. otherwise the resulting patch will be a series of
776 deletion and insertion mixed together with context lines).</p></div>
777 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
778 source of a rename (usually -M only considers a file that disappeared
779 as the source of a rename), and the number <tt>n</tt> controls this aspect of
780 the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
781 addition and deletion compared to 20% or more of the file&#8217;s size are
782 eligible for being picked up as a possible source of a rename to
783 another file.</p></div>
784 </dd>
785 <dt class="hdlist1">
786 -M[&lt;n&gt;]
787 </dt>
788 <dt class="hdlist1">
789 --find-renames[=&lt;n&gt;]
790 </dt>
791 <dd>
793 Detect renames.
794 If <tt>n</tt> is specified, it is a is a threshold on the similarity
795 index (i.e. amount of addition/deletions compared to the
796 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
797 delete/add pair to be a rename if more than 90% of the file
798 hasn&#8217;t changed.
799 </p>
800 </dd>
801 <dt class="hdlist1">
802 -C[&lt;n&gt;]
803 </dt>
804 <dt class="hdlist1">
805 --find-copies[=&lt;n&gt;]
806 </dt>
807 <dd>
809 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
810 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
811 </p>
812 </dd>
813 <dt class="hdlist1">
814 --find-copies-harder
815 </dt>
816 <dd>
818 For performance reasons, by default, <tt>-C</tt> option finds copies only
819 if the original file of the copy was modified in the same
820 changeset. This flag makes the command
821 inspect unmodified files as candidates for the source of
822 copy. This is a very expensive operation for large
823 projects, so use it with caution. Giving more than one
824 <tt>-C</tt> option has the same effect.
825 </p>
826 </dd>
827 <dt class="hdlist1">
829 </dt>
830 <dt class="hdlist1">
831 --irreversible-delete
832 </dt>
833 <dd>
835 Omit the preimage for deletes, i.e. print only the header but not
836 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
837 is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is
838 solely for people who want to just concentrate on reviewing the
839 text after the change. In addition, the output obviously lack
840 enough information to apply such a patch in reverse, even manually,
841 hence the name of the option.
842 </p>
843 <div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
844 of a delete/create pair.</p></div>
845 </dd>
846 <dt class="hdlist1">
847 -l&lt;num&gt;
848 </dt>
849 <dd>
851 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
852 is the number of potential rename/copy targets. This
853 option prevents rename/copy detection from running if
854 the number of rename/copy targets exceeds the specified
855 number.
856 </p>
857 </dd>
858 <dt class="hdlist1">
859 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
860 </dt>
861 <dd>
863 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
864 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
865 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
866 are Unmerged (<tt>U</tt>), are
867 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
868 Any combination of the filter characters (including none) can be used.
869 When <tt>*</tt> (All-or-none) is added to the combination, all
870 paths are selected if there is any file that matches
871 other criteria in the comparison; if there is no file
872 that matches other criteria, nothing is selected.
873 </p>
874 </dd>
875 <dt class="hdlist1">
876 -S&lt;string&gt;
877 </dt>
878 <dd>
880 Look for differences that introduce or remove an instance of
881 &lt;string&gt;. Note that this is different than the string simply
882 appearing in diff output; see the <em>pickaxe</em> entry in
883 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
884 </p>
885 </dd>
886 <dt class="hdlist1">
887 -G&lt;regex&gt;
888 </dt>
889 <dd>
891 Look for differences whose added or removed line matches
892 the given &lt;regex&gt;.
893 </p>
894 </dd>
895 <dt class="hdlist1">
896 --pickaxe-all
897 </dt>
898 <dd>
900 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
901 changeset, not just the files that contain the change
902 in &lt;string&gt;.
903 </p>
904 </dd>
905 <dt class="hdlist1">
906 --pickaxe-regex
907 </dt>
908 <dd>
910 Make the &lt;string&gt; not a plain string but an extended POSIX
911 regex to match.
912 </p>
913 </dd>
914 <dt class="hdlist1">
915 -O&lt;orderfile&gt;
916 </dt>
917 <dd>
919 Output the patch in the order specified in the
920 &lt;orderfile&gt;, which has one shell glob pattern per line.
921 </p>
922 </dd>
923 <dt class="hdlist1">
925 </dt>
926 <dd>
928 Swap two inputs; that is, show differences from index or
929 on-disk file to tree contents.
930 </p>
931 </dd>
932 <dt class="hdlist1">
933 --relative[=&lt;path&gt;]
934 </dt>
935 <dd>
937 When run from a subdirectory of the project, it can be
938 told to exclude changes outside the directory and show
939 pathnames relative to it with this option. When you are
940 not in a subdirectory (e.g. in a bare repository), you
941 can name which subdirectory to make the output relative
942 to by giving a &lt;path&gt; as an argument.
943 </p>
944 </dd>
945 <dt class="hdlist1">
947 </dt>
948 <dt class="hdlist1">
949 --text
950 </dt>
951 <dd>
953 Treat all files as text.
954 </p>
955 </dd>
956 <dt class="hdlist1">
957 --ignore-space-at-eol
958 </dt>
959 <dd>
961 Ignore changes in whitespace at EOL.
962 </p>
963 </dd>
964 <dt class="hdlist1">
966 </dt>
967 <dt class="hdlist1">
968 --ignore-space-change
969 </dt>
970 <dd>
972 Ignore changes in amount of whitespace. This ignores whitespace
973 at line end, and considers all other sequences of one or
974 more whitespace characters to be equivalent.
975 </p>
976 </dd>
977 <dt class="hdlist1">
979 </dt>
980 <dt class="hdlist1">
981 --ignore-all-space
982 </dt>
983 <dd>
985 Ignore whitespace when comparing lines. This ignores
986 differences even if one line has whitespace where the other
987 line has none.
988 </p>
989 </dd>
990 <dt class="hdlist1">
991 --inter-hunk-context=&lt;lines&gt;
992 </dt>
993 <dd>
995 Show the context between diff hunks, up to the specified number
996 of lines, thereby fusing hunks that are close to each other.
997 </p>
998 </dd>
999 <dt class="hdlist1">
1000 --exit-code
1001 </dt>
1002 <dd>
1004 Make the program exit with codes similar to diff(1).
1005 That is, it exits with 1 if there were differences and
1006 0 means no differences.
1007 </p>
1008 </dd>
1009 <dt class="hdlist1">
1010 --quiet
1011 </dt>
1012 <dd>
1014 Disable all output of the program. Implies <tt>--exit-code</tt>.
1015 </p>
1016 </dd>
1017 <dt class="hdlist1">
1018 --ext-diff
1019 </dt>
1020 <dd>
1022 Allow an external diff helper to be executed. If you set an
1023 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1024 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
1025 </p>
1026 </dd>
1027 <dt class="hdlist1">
1028 --no-ext-diff
1029 </dt>
1030 <dd>
1032 Disallow external diff drivers.
1033 </p>
1034 </dd>
1035 <dt class="hdlist1">
1036 --ignore-submodules[=&lt;when&gt;]
1037 </dt>
1038 <dd>
1040 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
1041 either "none", "untracked", "dirty" or "all", which is the default
1042 Using "none" will consider the submodule modified when it either contains
1043 untracked or modified files or its HEAD differs from the commit recorded
1044 in the superproject and can be used to override any settings of the
1045 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
1046 "untracked" is used submodules are not considered dirty when they only
1047 contain untracked content (but they are still scanned for modified
1048 content). Using "dirty" ignores all changes to the work tree of submodules,
1049 only changes to the commits stored in the superproject are shown (this was
1050 the behavior until 1.7.0). Using "all" hides all changes to submodules.
1051 </p>
1052 </dd>
1053 <dt class="hdlist1">
1054 --src-prefix=&lt;prefix&gt;
1055 </dt>
1056 <dd>
1058 Show the given source prefix instead of "a/".
1059 </p>
1060 </dd>
1061 <dt class="hdlist1">
1062 --dst-prefix=&lt;prefix&gt;
1063 </dt>
1064 <dd>
1066 Show the given destination prefix instead of "b/".
1067 </p>
1068 </dd>
1069 <dt class="hdlist1">
1070 --no-prefix
1071 </dt>
1072 <dd>
1074 Do not show any source or destination prefix.
1075 </p>
1076 </dd>
1077 </dl></div>
1078 <div class="paragraph"><p>For more detailed explanation on these common options, see also
1079 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
1080 <div class="dlist"><dl>
1081 <dt class="hdlist1">
1082 &lt;tree-ish&gt;
1083 </dt>
1084 <dd>
1086 The id of a tree object.
1087 </p>
1088 </dd>
1089 <dt class="hdlist1">
1090 &lt;path&gt;&#8230;
1091 </dt>
1092 <dd>
1094 If provided, the results are limited to a subset of files
1095 matching one of these prefix strings.
1096 i.e., file matches <tt>/^&lt;pattern1&gt;|&lt;pattern2&gt;|&#8230;/</tt>
1097 Note that this parameter does not provide any wildcard or regexp
1098 features.
1099 </p>
1100 </dd>
1101 <dt class="hdlist1">
1103 </dt>
1104 <dd>
1106 recurse into sub-trees
1107 </p>
1108 </dd>
1109 <dt class="hdlist1">
1111 </dt>
1112 <dd>
1114 show tree entry itself as well as subtrees. Implies -r.
1115 </p>
1116 </dd>
1117 <dt class="hdlist1">
1118 --root
1119 </dt>
1120 <dd>
1122 When <em>--root</em> is specified the initial commit will be shown as a big
1123 creation event. This is equivalent to a diff against the NULL tree.
1124 </p>
1125 </dd>
1126 <dt class="hdlist1">
1127 --stdin
1128 </dt>
1129 <dd>
1131 When <em>--stdin</em> is specified, the command does not take
1132 &lt;tree-ish&gt; arguments from the command line. Instead, it
1133 reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1134 list of &lt;commit&gt; from its standard input. (Use a single space
1135 as separator.)
1136 </p>
1137 <div class="paragraph"><p>When two trees are given, it compares the first tree with the second.
1138 When a single commit is given, it compares the commit with its
1139 parents. The remaining commits, when given, are used as if they are
1140 parents of the first commit.</p></div>
1141 <div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
1142 and terminated by a newline) is printed before the difference. When
1143 comparing commits, the ID of the first (or only) commit, followed by a
1144 newline, is printed.</p></div>
1145 <div class="paragraph"><p>The following flags further affect the behavior when comparing
1146 commits (but not trees).</p></div>
1147 </dd>
1148 <dt class="hdlist1">
1150 </dt>
1151 <dd>
1153 By default, <em>git diff-tree --stdin</em> does not show
1154 differences for merge commits. With this flag, it shows
1155 differences to that commit from all of its parents. See
1156 also <em>-c</em>.
1157 </p>
1158 </dd>
1159 <dt class="hdlist1">
1161 </dt>
1162 <dd>
1164 By default, <em>git diff-tree --stdin</em> shows differences,
1165 either in machine-readable form (without <em>-p</em>) or in patch
1166 form (with <em>-p</em>). This output can be suppressed. It is
1167 only useful with <em>-v</em> flag.
1168 </p>
1169 </dd>
1170 <dt class="hdlist1">
1172 </dt>
1173 <dd>
1175 This flag causes <em>git diff-tree --stdin</em> to also show
1176 the commit message before the differences.
1177 </p>
1178 </dd>
1179 <dt class="hdlist1">
1180 --pretty[=&lt;format&gt;]
1181 </dt>
1182 <dt class="hdlist1">
1183 --format=&lt;format&gt;
1184 </dt>
1185 <dd>
1187 Pretty-print the contents of the commit logs in a given format,
1188 where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1189 <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:&lt;string&gt;</em>. See
1190 the "PRETTY FORMATS" section for some additional details for each
1191 format. When omitted, the format defaults to <em>medium</em>.
1192 </p>
1193 <div class="paragraph"><p>Note: you can specify the default pretty format in the repository
1194 configuration (see <a href="git-config.html">git-config(1)</a>).</p></div>
1195 </dd>
1196 <dt class="hdlist1">
1197 --abbrev-commit
1198 </dt>
1199 <dd>
1201 Instead of showing the full 40-byte hexadecimal commit object
1202 name, show only a partial prefix. Non default number of
1203 digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies
1204 diff output, if it is displayed).
1205 </p>
1206 <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for
1207 people using 80-column terminals.</p></div>
1208 </dd>
1209 <dt class="hdlist1">
1210 --oneline
1211 </dt>
1212 <dd>
1214 This is a shorthand for "--pretty=oneline --abbrev-commit"
1215 used together.
1216 </p>
1217 </dd>
1218 <dt class="hdlist1">
1219 --encoding[=&lt;encoding&gt;]
1220 </dt>
1221 <dd>
1223 The commit objects record the encoding used for the log message
1224 in their encoding header; this option can be used to tell the
1225 command to re-code the commit log message in the encoding
1226 preferred by the user. For non plumbing commands this
1227 defaults to UTF-8.
1228 </p>
1229 </dd>
1230 <dt class="hdlist1">
1231 --notes[=&lt;ref&gt;]
1232 </dt>
1233 <dd>
1235 Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1236 commit, when showing the commit log message. This is the default
1237 for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when
1238 there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given
1239 on the command line.
1240 </p>
1241 <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the
1242 <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding
1243 environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div>
1244 <div class="paragraph"><p>With an optional <em>&lt;ref&gt;</em> argument, show this notes ref instead of the
1245 default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it
1246 is not qualified.</p></div>
1247 <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are
1248 being displayed. Examples: "--notes=foo" will show only notes from
1249 "refs/notes/foo"; "--notes=foo --notes" will show both notes from
1250 "refs/notes/foo" and from the default notes ref(s).</p></div>
1251 </dd>
1252 <dt class="hdlist1">
1253 --no-notes
1254 </dt>
1255 <dd>
1257 Do not show notes. This negates the above <tt>--notes</tt> option, by
1258 resetting the list of notes refs from which notes are shown.
1259 Options are parsed in the order given on the command line, so e.g.
1260 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1261 from "refs/notes/bar".
1262 </p>
1263 </dd>
1264 <dt class="hdlist1">
1265 --show-notes[=&lt;ref&gt;]
1266 </dt>
1267 <dt class="hdlist1">
1268 --[no-]standard-notes
1269 </dt>
1270 <dd>
1272 These options are deprecated. Use the above --notes/--no-notes
1273 options instead.
1274 </p>
1275 </dd>
1276 <dt class="hdlist1">
1277 --no-commit-id
1278 </dt>
1279 <dd>
1281 <em>git diff-tree</em> outputs a line with the commit ID when
1282 applicable. This flag suppressed the commit ID output.
1283 </p>
1284 </dd>
1285 <dt class="hdlist1">
1287 </dt>
1288 <dd>
1290 This flag changes the way a merge commit is displayed
1291 (which means it is useful only when the command is given
1292 one &lt;tree-ish&gt;, or <em>--stdin</em>). It shows the differences
1293 from each of the parents to the merge result simultaneously
1294 instead of showing pairwise diff between a parent and the
1295 result one at a time (which is what the <em>-m</em> option does).
1296 Furthermore, it lists only files which were modified
1297 from all parents.
1298 </p>
1299 </dd>
1300 <dt class="hdlist1">
1301 --cc
1302 </dt>
1303 <dd>
1305 This flag changes the way a merge commit patch is displayed,
1306 in a similar way to the <em>-c</em> option. It implies the <em>-c</em>
1307 and <em>-p</em> options and further compresses the patch output
1308 by omitting uninteresting hunks whose the contents in the parents
1309 have only two variants and the merge result picks one of them
1310 without modification. When all hunks are uninteresting, the commit
1311 itself and the commit log message is not shown, just like in any other
1312 "empty diff" case.
1313 </p>
1314 </dd>
1315 <dt class="hdlist1">
1316 --always
1317 </dt>
1318 <dd>
1320 Show the commit itself and the commit log message even
1321 if the diff itself is empty.
1322 </p>
1323 </dd>
1324 </dl></div>
1325 </div>
1326 <h2 id="_pretty_formats">PRETTY FORMATS</h2>
1327 <div class="sectionbody">
1328 <div class="paragraph"><p>If the commit is a merge, and if the pretty-format
1329 is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1330 inserted before the <em>Author:</em> line. This line begins with
1331 "Merge: " and the sha1s of ancestral commits are printed,
1332 separated by spaces. Note that the listed commits may not
1333 necessarily be the list of the <strong>direct</strong> parent commits if you
1334 have limited your view of history: for example, if you are
1335 only interested in changes related to a certain directory or
1336 file.</p></div>
1337 <div class="paragraph"><p>There are several built-in formats, and you can define
1338 additional formats by setting a pretty.&lt;name&gt;
1339 config option to either another format name, or a
1340 <em>format:</em> string, as described below (see
1341 <a href="git-config.html">git-config(1)</a>). Here are the details of the
1342 built-in formats:</p></div>
1343 <div class="ulist"><ul>
1344 <li>
1346 <em>oneline</em>
1347 </p>
1348 <div class="literalblock">
1349 <div class="content">
1350 <pre><tt>&lt;sha1&gt; &lt;title line&gt;</tt></pre>
1351 </div></div>
1352 <div class="paragraph"><p>This is designed to be as compact as possible.</p></div>
1353 </li>
1354 <li>
1356 <em>short</em>
1357 </p>
1358 <div class="literalblock">
1359 <div class="content">
1360 <pre><tt>commit &lt;sha1&gt;
1361 Author: &lt;author&gt;</tt></pre>
1362 </div></div>
1363 <div class="literalblock">
1364 <div class="content">
1365 <pre><tt>&lt;title line&gt;</tt></pre>
1366 </div></div>
1367 </li>
1368 <li>
1370 <em>medium</em>
1371 </p>
1372 <div class="literalblock">
1373 <div class="content">
1374 <pre><tt>commit &lt;sha1&gt;
1375 Author: &lt;author&gt;
1376 Date: &lt;author date&gt;</tt></pre>
1377 </div></div>
1378 <div class="literalblock">
1379 <div class="content">
1380 <pre><tt>&lt;title line&gt;</tt></pre>
1381 </div></div>
1382 <div class="literalblock">
1383 <div class="content">
1384 <pre><tt>&lt;full commit message&gt;</tt></pre>
1385 </div></div>
1386 </li>
1387 <li>
1389 <em>full</em>
1390 </p>
1391 <div class="literalblock">
1392 <div class="content">
1393 <pre><tt>commit &lt;sha1&gt;
1394 Author: &lt;author&gt;
1395 Commit: &lt;committer&gt;</tt></pre>
1396 </div></div>
1397 <div class="literalblock">
1398 <div class="content">
1399 <pre><tt>&lt;title line&gt;</tt></pre>
1400 </div></div>
1401 <div class="literalblock">
1402 <div class="content">
1403 <pre><tt>&lt;full commit message&gt;</tt></pre>
1404 </div></div>
1405 </li>
1406 <li>
1408 <em>fuller</em>
1409 </p>
1410 <div class="literalblock">
1411 <div class="content">
1412 <pre><tt>commit &lt;sha1&gt;
1413 Author: &lt;author&gt;
1414 AuthorDate: &lt;author date&gt;
1415 Commit: &lt;committer&gt;
1416 CommitDate: &lt;committer date&gt;</tt></pre>
1417 </div></div>
1418 <div class="literalblock">
1419 <div class="content">
1420 <pre><tt>&lt;title line&gt;</tt></pre>
1421 </div></div>
1422 <div class="literalblock">
1423 <div class="content">
1424 <pre><tt>&lt;full commit message&gt;</tt></pre>
1425 </div></div>
1426 </li>
1427 <li>
1429 <em>email</em>
1430 </p>
1431 <div class="literalblock">
1432 <div class="content">
1433 <pre><tt>From &lt;sha1&gt; &lt;date&gt;
1434 From: &lt;author&gt;
1435 Date: &lt;author date&gt;
1436 Subject: [PATCH] &lt;title line&gt;</tt></pre>
1437 </div></div>
1438 <div class="literalblock">
1439 <div class="content">
1440 <pre><tt>&lt;full commit message&gt;</tt></pre>
1441 </div></div>
1442 </li>
1443 <li>
1445 <em>raw</em>
1446 </p>
1447 <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as
1448 stored in the commit object. Notably, the SHA1s are
1449 displayed in full, regardless of whether --abbrev or
1450 --no-abbrev are used, and <em>parents</em> information show the
1451 true parent commits, without taking grafts nor history
1452 simplification into account.</p></div>
1453 </li>
1454 <li>
1456 <em>format:&lt;string&gt;</em>
1457 </p>
1458 <div class="paragraph"><p>The <em>format:&lt;string&gt;</em> format allows you to specify which information
1459 you want to show. It works a little bit like printf format,
1460 with the notable exception that you get a newline with <em>%n</em>
1461 instead of <em>\n</em>.</p></div>
1462 <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>
1463 would show something like this:</p></div>
1464 <div class="listingblock">
1465 <div class="content">
1466 <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1467 The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</tt></pre>
1468 </div></div>
1469 <div class="paragraph"><p>The placeholders are:</p></div>
1470 <div class="ulist"><ul>
1471 <li>
1473 <em>%H</em>: commit hash
1474 </p>
1475 </li>
1476 <li>
1478 <em>%h</em>: abbreviated commit hash
1479 </p>
1480 </li>
1481 <li>
1483 <em>%T</em>: tree hash
1484 </p>
1485 </li>
1486 <li>
1488 <em>%t</em>: abbreviated tree hash
1489 </p>
1490 </li>
1491 <li>
1493 <em>%P</em>: parent hashes
1494 </p>
1495 </li>
1496 <li>
1498 <em>%p</em>: abbreviated parent hashes
1499 </p>
1500 </li>
1501 <li>
1503 <em>%an</em>: author name
1504 </p>
1505 </li>
1506 <li>
1508 <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>)
1509 </p>
1510 </li>
1511 <li>
1513 <em>%ae</em>: author email
1514 </p>
1515 </li>
1516 <li>
1518 <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>)
1519 </p>
1520 </li>
1521 <li>
1523 <em>%ad</em>: author date (format respects --date= option)
1524 </p>
1525 </li>
1526 <li>
1528 <em>%aD</em>: author date, RFC2822 style
1529 </p>
1530 </li>
1531 <li>
1533 <em>%ar</em>: author date, relative
1534 </p>
1535 </li>
1536 <li>
1538 <em>%at</em>: author date, UNIX timestamp
1539 </p>
1540 </li>
1541 <li>
1543 <em>%ai</em>: author date, ISO 8601 format
1544 </p>
1545 </li>
1546 <li>
1548 <em>%cn</em>: committer name
1549 </p>
1550 </li>
1551 <li>
1553 <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>)
1554 </p>
1555 </li>
1556 <li>
1558 <em>%ce</em>: committer email
1559 </p>
1560 </li>
1561 <li>
1563 <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>)
1564 </p>
1565 </li>
1566 <li>
1568 <em>%cd</em>: committer date
1569 </p>
1570 </li>
1571 <li>
1573 <em>%cD</em>: committer date, RFC2822 style
1574 </p>
1575 </li>
1576 <li>
1578 <em>%cr</em>: committer date, relative
1579 </p>
1580 </li>
1581 <li>
1583 <em>%ct</em>: committer date, UNIX timestamp
1584 </p>
1585 </li>
1586 <li>
1588 <em>%ci</em>: committer date, ISO 8601 format
1589 </p>
1590 </li>
1591 <li>
1593 <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>
1594 </p>
1595 </li>
1596 <li>
1598 <em>%e</em>: encoding
1599 </p>
1600 </li>
1601 <li>
1603 <em>%s</em>: subject
1604 </p>
1605 </li>
1606 <li>
1608 <em>%f</em>: sanitized subject line, suitable for a filename
1609 </p>
1610 </li>
1611 <li>
1613 <em>%b</em>: body
1614 </p>
1615 </li>
1616 <li>
1618 <em>%B</em>: raw body (unwrapped subject and body)
1619 </p>
1620 </li>
1621 <li>
1623 <em>%N</em>: commit notes
1624 </p>
1625 </li>
1626 <li>
1628 <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt>
1629 </p>
1630 </li>
1631 <li>
1633 <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt>
1634 </p>
1635 </li>
1636 <li>
1638 <em>%gs</em>: reflog subject
1639 </p>
1640 </li>
1641 <li>
1643 <em>%Cred</em>: switch color to red
1644 </p>
1645 </li>
1646 <li>
1648 <em>%Cgreen</em>: switch color to green
1649 </p>
1650 </li>
1651 <li>
1653 <em>%Cblue</em>: switch color to blue
1654 </p>
1655 </li>
1656 <li>
1658 <em>%Creset</em>: reset color
1659 </p>
1660 </li>
1661 <li>
1663 <em>%C(&#8230;)</em>: color specification, as described in color.branch.* config option
1664 </p>
1665 </li>
1666 <li>
1668 <em>%m</em>: left, right or boundary mark
1669 </p>
1670 </li>
1671 <li>
1673 <em>%n</em>: newline
1674 </p>
1675 </li>
1676 <li>
1678 <em>%%</em>: a raw <em>%</em>
1679 </p>
1680 </li>
1681 <li>
1683 <em>%x00</em>: print a byte from a hex code
1684 </p>
1685 </li>
1686 <li>
1688 <em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em>: switch line wrapping, like the -w option of
1689 <a href="git-shortlog.html">git-shortlog(1)</a>.
1690 </p>
1691 </li>
1692 </ul></div>
1693 </li>
1694 </ul></div>
1695 <div class="admonitionblock">
1696 <table><tr>
1697 <td class="icon">
1698 <div class="title">Note</div>
1699 </td>
1700 <td class="content">Some placeholders may depend on other options given to the
1701 revision traversal engine. For example, the <tt>%g*</tt> reflog options will
1702 insert an empty string unless we are traversing reflog entries (e.g., by
1703 <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration
1704 format if <tt>--decorate</tt> was not already provided on the command line.</td>
1705 </tr></table>
1706 </div>
1707 <div class="paragraph"><p>If you add a <tt>&#43;</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed
1708 is inserted immediately before the expansion if and only if the
1709 placeholder expands to a non-empty string.</p></div>
1710 <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that
1711 immediately precede the expansion are deleted if and only if the
1712 placeholder expands to an empty string.</p></div>
1713 <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
1714 is inserted immediately before the expansion if and only if the
1715 placeholder expands to a non-empty string.</p></div>
1716 <div class="ulist"><ul>
1717 <li>
1719 <em>tformat:</em>
1720 </p>
1721 <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
1722 provides "terminator" semantics instead of "separator" semantics. In
1723 other words, each commit has the message terminator character (usually a
1724 newline) appended, rather than a separator placed between entries.
1725 This means that the final entry of a single-line format will be properly
1726 terminated with a new line, just as the "oneline" format does.
1727 For example:</p></div>
1728 <div class="listingblock">
1729 <div class="content">
1730 <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \
1731 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
1732 4da45be
1733 7134973 -- NO NEWLINE
1735 $ git log -2 --pretty=tformat:%h 4da45bef \
1736 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
1737 4da45be
1738 7134973</tt></pre>
1739 </div></div>
1740 <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted
1741 as if it has <tt>tformat:</tt> in front of it. For example, these two are
1742 equivalent:</p></div>
1743 <div class="listingblock">
1744 <div class="content">
1745 <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef
1746 $ git log -2 --pretty=%h 4da45bef</tt></pre>
1747 </div></div>
1748 </li>
1749 </ul></div>
1750 </div>
1751 <h2 id="_limiting_output">Limiting Output</h2>
1752 <div class="sectionbody">
1753 <div class="paragraph"><p>If you&#8217;re only interested in differences in a subset of files, for
1754 example some architecture-specific files, you might do:</p></div>
1755 <div class="literalblock">
1756 <div class="content">
1757 <pre><tt>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; arch/ia64 include/asm-ia64</tt></pre>
1758 </div></div>
1759 <div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div>
1760 <div class="paragraph"><p>Or if you are searching for what changed in just <tt>kernel/sched.c</tt>, just do</p></div>
1761 <div class="literalblock">
1762 <div class="content">
1763 <pre><tt>git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; kernel/sched.c</tt></pre>
1764 </div></div>
1765 <div class="paragraph"><p>and it will ignore all differences to other files.</p></div>
1766 <div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no
1767 wildcards. Even stricter, it has to match a complete path component.
1768 I.e. "foo" does not pick up <tt>foobar.h</tt>. "foo" does match <tt>foo/bar.h</tt>
1769 so it can be used to name subdirectories.</p></div>
1770 <div class="paragraph"><p>An example of normal usage is:</p></div>
1771 <div class="literalblock">
1772 <div class="content">
1773 <pre><tt>torvalds@ppc970:~/git&gt; git diff-tree 5319e4......
1774 *100664-&gt;100664 blob ac348b.......-&gt;a01513....... git-fsck-objects.c</tt></pre>
1775 </div></div>
1776 <div class="paragraph"><p>which tells you that the last commit changed just one file (it&#8217;s from
1777 this one:</p></div>
1778 <div class="listingblock">
1779 <div class="content">
1780 <pre><tt>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8
1781 tree 5319e4d609cdd282069cc4dce33c1db559539b03
1782 parent b4e628ea30d5ab3606119d2ea5caeab141d38df7
1783 author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
1784 committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005
1786 Make "git-fsck-objects" print out all the root commits it finds.
1788 Once I do the reference tracking, I'll also make it print out all the
1789 HEAD commits it finds, which is even more interesting.</tt></pre>
1790 </div></div>
1791 <div class="paragraph"><p>in case you care).</p></div>
1792 </div>
1793 <h2 id="_raw_output_format">Raw output format</h2>
1794 <div class="sectionbody">
1795 <div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
1796 "git-diff-files" and "git diff --raw" are very similar.</p></div>
1797 <div class="paragraph"><p>These commands all compare two sets of things; what is
1798 compared differs:</p></div>
1799 <div class="dlist"><dl>
1800 <dt class="hdlist1">
1801 git-diff-index &lt;tree-ish&gt;
1802 </dt>
1803 <dd>
1805 compares the &lt;tree-ish&gt; and the files on the filesystem.
1806 </p>
1807 </dd>
1808 <dt class="hdlist1">
1809 git-diff-index --cached &lt;tree-ish&gt;
1810 </dt>
1811 <dd>
1813 compares the &lt;tree-ish&gt; and the index.
1814 </p>
1815 </dd>
1816 <dt class="hdlist1">
1817 git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1818 </dt>
1819 <dd>
1821 compares the trees named by the two arguments.
1822 </p>
1823 </dd>
1824 <dt class="hdlist1">
1825 git-diff-files [&lt;pattern&gt;&#8230;]
1826 </dt>
1827 <dd>
1829 compares the index and the files on the filesystem.
1830 </p>
1831 </dd>
1832 </dl></div>
1833 <div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
1834 what is being compared. After that, all the commands print one output
1835 line per changed file.</p></div>
1836 <div class="paragraph"><p>An output line is formatted this way:</p></div>
1837 <div class="listingblock">
1838 <div class="content">
1839 <pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
1840 copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1841 rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1842 create :000000 100644 0000000... 1234567... A file4
1843 delete :100644 000000 1234567... 0000000... D file5
1844 unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
1845 </div></div>
1846 <div class="paragraph"><p>That is, from the left to the right:</p></div>
1847 <div class="olist arabic"><ol class="arabic">
1848 <li>
1850 a colon.
1851 </p>
1852 </li>
1853 <li>
1855 mode for "src"; 000000 if creation or unmerged.
1856 </p>
1857 </li>
1858 <li>
1860 a space.
1861 </p>
1862 </li>
1863 <li>
1865 mode for "dst"; 000000 if deletion or unmerged.
1866 </p>
1867 </li>
1868 <li>
1870 a space.
1871 </p>
1872 </li>
1873 <li>
1875 sha1 for "src"; 0{40} if creation or unmerged.
1876 </p>
1877 </li>
1878 <li>
1880 a space.
1881 </p>
1882 </li>
1883 <li>
1885 sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1886 </p>
1887 </li>
1888 <li>
1890 a space.
1891 </p>
1892 </li>
1893 <li>
1895 status, followed by optional "score" number.
1896 </p>
1897 </li>
1898 <li>
1900 a tab or a NUL when <em>-z</em> option is used.
1901 </p>
1902 </li>
1903 <li>
1905 path for "src"
1906 </p>
1907 </li>
1908 <li>
1910 a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1911 </p>
1912 </li>
1913 <li>
1915 path for "dst"; only exists for C or R.
1916 </p>
1917 </li>
1918 <li>
1920 an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1921 </p>
1922 </li>
1923 </ol></div>
1924 <div class="paragraph"><p>Possible status letters are:</p></div>
1925 <div class="ulist"><ul>
1926 <li>
1928 A: addition of a file
1929 </p>
1930 </li>
1931 <li>
1933 C: copy of a file into a new one
1934 </p>
1935 </li>
1936 <li>
1938 D: deletion of a file
1939 </p>
1940 </li>
1941 <li>
1943 M: modification of the contents or mode of a file
1944 </p>
1945 </li>
1946 <li>
1948 R: renaming of a file
1949 </p>
1950 </li>
1951 <li>
1953 T: change in the type of the file
1954 </p>
1955 </li>
1956 <li>
1958 U: file is unmerged (you must complete the merge before it can
1959 be committed)
1960 </p>
1961 </li>
1962 <li>
1964 X: "unknown" change type (most probably a bug, please report it)
1965 </p>
1966 </li>
1967 </ul></div>
1968 <div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
1969 percentage of similarity between the source and target of the move or
1970 copy), and are the only ones to be so.</p></div>
1971 <div class="paragraph"><p>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem
1972 and it is out of sync with the index.</p></div>
1973 <div class="paragraph"><p>Example:</p></div>
1974 <div class="listingblock">
1975 <div class="content">
1976 <pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
1977 </div></div>
1978 <div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
1979 in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
1980 respectively.</p></div>
1981 </div>
1982 <h2 id="_diff_format_for_merges">diff format for merges</h2>
1983 <div class="sectionbody">
1984 <div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
1985 can take <em>-c</em> or <em>--cc</em> option
1986 to generate diff output also for merge commits. The output differs
1987 from the format described above in the following way:</p></div>
1988 <div class="olist arabic"><ol class="arabic">
1989 <li>
1991 there is a colon for each parent
1992 </p>
1993 </li>
1994 <li>
1996 there are more "src" modes and "src" sha1
1997 </p>
1998 </li>
1999 <li>
2001 status is concatenated status characters for each parent
2002 </p>
2003 </li>
2004 <li>
2006 no optional "score" number
2007 </p>
2008 </li>
2009 <li>
2011 single path, only for "dst"
2012 </p>
2013 </li>
2014 </ol></div>
2015 <div class="paragraph"><p>Example:</p></div>
2016 <div class="listingblock">
2017 <div class="content">
2018 <pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
2019 </div></div>
2020 <div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
2021 all parents.</p></div>
2022 </div>
2023 <h2 id="_generating_patches_with_p">Generating patches with -p</h2>
2024 <div class="sectionbody">
2025 <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
2026 with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
2027 "git log" with the "-p" option, they
2028 do not produce the output described above; instead they produce a
2029 patch file. You can customize the creation of such patches via the
2030 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
2031 <div class="paragraph"><p>What the -p option produces is slightly different from the traditional
2032 diff format:</p></div>
2033 <div class="olist arabic"><ol class="arabic">
2034 <li>
2036 It is preceded with a "git diff" header that looks like this:
2037 </p>
2038 <div class="literalblock">
2039 <div class="content">
2040 <pre><tt>diff --git a/file1 b/file2</tt></pre>
2041 </div></div>
2042 <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
2043 involved. Especially, even for a creation or a deletion,
2044 <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
2045 <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
2046 name of the source file of the rename/copy and the name of
2047 the file that rename/copy produces, respectively.</p></div>
2048 </li>
2049 <li>
2051 It is followed by one or more extended header lines:
2052 </p>
2053 <div class="literalblock">
2054 <div class="content">
2055 <pre><tt>old mode &lt;mode&gt;
2056 new mode &lt;mode&gt;
2057 deleted file mode &lt;mode&gt;
2058 new file mode &lt;mode&gt;
2059 copy from &lt;path&gt;
2060 copy to &lt;path&gt;
2061 rename from &lt;path&gt;
2062 rename to &lt;path&gt;
2063 similarity index &lt;number&gt;
2064 dissimilarity index &lt;number&gt;
2065 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
2066 </div></div>
2067 <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
2068 and file permission bits.</p></div>
2069 <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
2070 <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
2071 the dissimilarity index is the percentage of changed lines. It
2072 is a rounded down integer, followed by a percent sign. The
2073 similarity index value of 100% is thus reserved for two equal
2074 files, while 100% dissimilarity means that no line from the old
2075 file made it into the new one.</p></div>
2076 <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
2077 The &lt;mode&gt; is included if the file mode does not change; otherwise,
2078 separate lines indicate the old and the new mode.</p></div>
2079 </li>
2080 <li>
2082 TAB, LF, double quote and backslash characters in pathnames
2083 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
2084 If there is need for such substitution then the whole
2085 pathname is put in double quotes.
2086 </p>
2087 </li>
2088 <li>
2090 All the <tt>file1</tt> files in the output refer to files before the
2091 commit, and all the <tt>file2</tt> files refer to files after the commit.
2092 It is incorrect to apply each change to each file sequentially. For
2093 example, this patch will swap a and b:
2094 </p>
2095 <div class="literalblock">
2096 <div class="content">
2097 <pre><tt>diff --git a/a b/b
2098 rename from a
2099 rename to b
2100 diff --git a/b b/a
2101 rename from b
2102 rename to a</tt></pre>
2103 </div></div>
2104 </li>
2105 </ol></div>
2106 </div>
2107 <h2 id="_combined_diff_format">combined diff format</h2>
2108 <div class="sectionbody">
2109 <div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
2110 produce a <em>combined diff</em> when showing a merge. This is the default
2111 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2112 <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
2113 of these commands to force generation of diffs with individual parents
2114 of a merge.</p></div>
2115 <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
2116 <div class="listingblock">
2117 <div class="content">
2118 <pre><tt>diff --combined describe.c
2119 index fabadb8,cc95eb0..4866510
2120 --- a/describe.c
2121 +++ b/describe.c
2122 @@@ -98,20 -98,12 +98,20 @@@
2123 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2126 - static void describe(char *arg)
2127 -static void describe(struct commit *cmit, int last_one)
2128 ++static void describe(char *arg, int last_one)
2130 + unsigned char sha1[20];
2131 + struct commit *cmit;
2132 struct commit_list *list;
2133 static int initialized = 0;
2134 struct commit_name *n;
2136 + if (get_sha1(arg, sha1) &lt; 0)
2137 + usage(describe_usage);
2138 + cmit = lookup_commit_reference(sha1);
2139 + if (!cmit)
2140 + usage(describe_usage);
2142 if (!initialized) {
2143 initialized = 1;
2144 for_each_ref(get_name);</tt></pre>
2145 </div></div>
2146 <div class="olist arabic"><ol class="arabic">
2147 <li>
2149 It is preceded with a "git diff" header, that looks like
2150 this (when <em>-c</em> option is used):
2151 </p>
2152 <div class="literalblock">
2153 <div class="content">
2154 <pre><tt>diff --combined file</tt></pre>
2155 </div></div>
2156 <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
2157 <div class="literalblock">
2158 <div class="content">
2159 <pre><tt>diff --cc file</tt></pre>
2160 </div></div>
2161 </li>
2162 <li>
2164 It is followed by one or more extended header lines
2165 (this example shows a merge with two parents):
2166 </p>
2167 <div class="literalblock">
2168 <div class="content">
2169 <pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2170 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2171 new file mode &lt;mode&gt;
2172 deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
2173 </div></div>
2174 <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
2175 the &lt;mode&gt; is different from the rest. Extended headers with
2176 information about detected contents movement (renames and
2177 copying detection) are designed to work with diff of two
2178 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
2179 </li>
2180 <li>
2182 It is followed by two-line from-file/to-file header
2183 </p>
2184 <div class="literalblock">
2185 <div class="content">
2186 <pre><tt>--- a/file
2187 +++ b/file</tt></pre>
2188 </div></div>
2189 <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
2190 format, <tt>/dev/null</tt> is used to signal created or deleted
2191 files.</p></div>
2192 </li>
2193 <li>
2195 Chunk header format is modified to prevent people from
2196 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
2197 was created for review of merge commit changes, and was not
2198 meant for apply. The change is similar to the change in the
2199 extended <em>index</em> header:
2200 </p>
2201 <div class="literalblock">
2202 <div class="content">
2203 <pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
2204 </div></div>
2205 <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
2206 header for combined diff format.</p></div>
2207 </li>
2208 </ol></div>
2209 <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
2210 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
2211 added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
2212 compares two or more files file1, file2,&#8230; with one file X, and
2213 shows how X differs from each of fileN. One column for each of
2214 fileN is prepended to the output line to note how X&#8217;s line is
2215 different from it.</p></div>
2216 <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
2217 fileN but it does not appear in the result. A <tt>+</tt> character
2218 in the column N means that the line appears in the result,
2219 and fileN does not have that line (in other words, the line was
2220 added, from the point of view of that parent).</p></div>
2221 <div class="paragraph"><p>In the above example output, the function signature was changed
2222 from both files (hence two <tt>-</tt> removals from both file1 and
2223 file2, plus <tt>++</tt> to mean one line that was added does not appear
2224 in either file1 nor file2). Also eight other lines are the same
2225 from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
2226 <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
2227 merge commit with the merge result (i.e. file1..fileN are the
2228 parents). When shown by <tt>git diff-files -c</tt>, it compares the
2229 two unresolved merge parents with the working tree file
2230 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2231 "their version").</p></div>
2232 </div>
2233 <h2 id="_other_diff_formats">other diff formats</h2>
2234 <div class="sectionbody">
2235 <div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
2236 copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
2237 output. These options can be combined with other options, such as
2238 <tt>-p</tt>, and are meant for human consumption.</p></div>
2239 <div class="paragraph"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output
2240 formats the pathnames compactly by combining common prefix and suffix of
2241 the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
2242 <tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
2243 <div class="listingblock">
2244 <div class="content">
2245 <pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
2246 </div></div>
2247 <div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
2248 for easier machine consumption. An entry in <tt>--numstat</tt> output looks
2249 like this:</p></div>
2250 <div class="listingblock">
2251 <div class="content">
2252 <pre><tt>1 2 README
2253 3 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
2254 </div></div>
2255 <div class="paragraph"><p>That is, from left to right:</p></div>
2256 <div class="olist arabic"><ol class="arabic">
2257 <li>
2259 the number of added lines;
2260 </p>
2261 </li>
2262 <li>
2264 a tab;
2265 </p>
2266 </li>
2267 <li>
2269 the number of deleted lines;
2270 </p>
2271 </li>
2272 <li>
2274 a tab;
2275 </p>
2276 </li>
2277 <li>
2279 pathname (possibly with rename/copy information);
2280 </p>
2281 </li>
2282 <li>
2284 a newline.
2285 </p>
2286 </li>
2287 </ol></div>
2288 <div class="paragraph"><p>When <tt>-z</tt> output option is in effect, the output is formatted this way:</p></div>
2289 <div class="listingblock">
2290 <div class="content">
2291 <pre><tt>1 2 README NUL
2292 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
2293 </div></div>
2294 <div class="paragraph"><p>That is:</p></div>
2295 <div class="olist arabic"><ol class="arabic">
2296 <li>
2298 the number of added lines;
2299 </p>
2300 </li>
2301 <li>
2303 a tab;
2304 </p>
2305 </li>
2306 <li>
2308 the number of deleted lines;
2309 </p>
2310 </li>
2311 <li>
2313 a tab;
2314 </p>
2315 </li>
2316 <li>
2318 a NUL (only exists if renamed/copied);
2319 </p>
2320 </li>
2321 <li>
2323 pathname in preimage;
2324 </p>
2325 </li>
2326 <li>
2328 a NUL (only exists if renamed/copied);
2329 </p>
2330 </li>
2331 <li>
2333 pathname in postimage (only exists if renamed/copied);
2334 </p>
2335 </li>
2336 <li>
2338 a NUL.
2339 </p>
2340 </li>
2341 </ol></div>
2342 <div class="paragraph"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow
2343 scripts that read the output to tell if the current record being read is
2344 a single-path record or a rename/copy record without reading ahead.
2345 After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
2346 the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
2347 </div>
2348 <h2 id="_git">GIT</h2>
2349 <div class="sectionbody">
2350 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2351 </div>
2352 <div id="footer">
2353 <div id="footer-text">
2354 Last updated 2011-03-15 23:30:13 UTC
2355 </div>
2356 </div>
2357 </body>
2358 </html>