Autogenerated HTML docs for v1.7.5-52-ge839f
[git/jnareb-git.git] / git-diff-files.html
blob1829e2cd68f2b326d542b81e1f19bb6ed2189f37
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-files(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-files(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-diff-files -
411 Compares files in the working tree and the index
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="paragraph"><p><em>git diff-files</em> [-q] [-0|-1|-2|-3|-c|--cc] [&lt;common diff options&gt;] [&lt;path&gt;&#8230;]</p></div>
418 </div>
419 <h2 id="_description">DESCRIPTION</h2>
420 <div class="sectionbody">
421 <div class="paragraph"><p>Compares the files in the working tree and the index. When paths
422 are specified, compares only those named paths. Otherwise all
423 entries in the index are compared. The output format is the
424 same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
425 </div>
426 <h2 id="_options">OPTIONS</h2>
427 <div class="sectionbody">
428 <div class="dlist"><dl>
429 <dt class="hdlist1">
431 </dt>
432 <dt class="hdlist1">
434 </dt>
435 <dt class="hdlist1">
436 --patch
437 </dt>
438 <dd>
440 Generate patch (see section on generating patches).
442 </p>
443 </dd>
444 <dt class="hdlist1">
445 -U&lt;n&gt;
446 </dt>
447 <dt class="hdlist1">
448 --unified=&lt;n&gt;
449 </dt>
450 <dd>
452 Generate diffs with &lt;n&gt; lines of context instead of
453 the usual three.
454 Implies <tt>-p</tt>.
455 </p>
456 </dd>
457 <dt class="hdlist1">
458 --raw
459 </dt>
460 <dd>
462 Generate the raw format.
463 This is the default.
464 </p>
465 </dd>
466 <dt class="hdlist1">
467 --patch-with-raw
468 </dt>
469 <dd>
471 Synonym for <tt>-p --raw</tt>.
472 </p>
473 </dd>
474 <dt class="hdlist1">
475 --patience
476 </dt>
477 <dd>
479 Generate a diff using the "patience diff" algorithm.
480 </p>
481 </dd>
482 <dt class="hdlist1">
483 --stat[=&lt;width&gt;[,&lt;name-width&gt;]]
484 </dt>
485 <dd>
487 Generate a diffstat. You can override the default
488 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
489 The width of the filename part can be controlled by
490 giving another width to it separated by a comma.
491 </p>
492 </dd>
493 <dt class="hdlist1">
494 --numstat
495 </dt>
496 <dd>
498 Similar to <tt>--stat</tt>, but shows number of added and
499 deleted lines in decimal notation and pathname without
500 abbreviation, to make it more machine friendly. For
501 binary files, outputs two <tt>-</tt> instead of saying
502 <tt>0 0</tt>.
503 </p>
504 </dd>
505 <dt class="hdlist1">
506 --shortstat
507 </dt>
508 <dd>
510 Output only the last line of the <tt>--stat</tt> format containing total
511 number of modified files, as well as number of added and deleted
512 lines.
513 </p>
514 </dd>
515 <dt class="hdlist1">
516 --dirstat[=&lt;limit&gt;]
517 </dt>
518 <dd>
520 Output the distribution of relative amount of changes (number of lines added or
521 removed) for each sub-directory. Directories with changes below
522 a cut-off percent (3% by default) are not shown. The cut-off percent
523 can be set with <tt>--dirstat=&lt;limit&gt;</tt>. Changes in a child directory are not
524 counted for the parent directory, unless <tt>--cumulative</tt> is used.
525 </p>
526 </dd>
527 <dt class="hdlist1">
528 --dirstat-by-file[=&lt;limit&gt;]
529 </dt>
530 <dd>
532 Same as <tt>--dirstat</tt>, but counts changed files instead of lines.
533 </p>
534 </dd>
535 <dt class="hdlist1">
536 --summary
537 </dt>
538 <dd>
540 Output a condensed summary of extended header information
541 such as creations, renames and mode changes.
542 </p>
543 </dd>
544 <dt class="hdlist1">
545 --patch-with-stat
546 </dt>
547 <dd>
549 Synonym for <tt>-p --stat</tt>.
550 </p>
551 </dd>
552 <dt class="hdlist1">
554 </dt>
555 <dd>
557 When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been
558 given, do not munge pathnames and use NULs as output field terminators.
559 </p>
560 <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
561 and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
562 respectively, and the pathname will be enclosed in double quotes if
563 any of those replacements occurred.</p></div>
564 </dd>
565 <dt class="hdlist1">
566 --name-only
567 </dt>
568 <dd>
570 Show only names of changed files.
571 </p>
572 </dd>
573 <dt class="hdlist1">
574 --name-status
575 </dt>
576 <dd>
578 Show only names and status of changed files. See the description
579 of the <tt>--diff-filter</tt> option on what the status letters mean.
580 </p>
581 </dd>
582 <dt class="hdlist1">
583 --submodule[=&lt;format&gt;]
584 </dt>
585 <dd>
587 Chose the output format for submodule differences. &lt;format&gt; can be one of
588 <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format
589 is used when this option is not given. <em>log</em> is the default value for this
590 option and lists the commits in that commit range like the <em>summary</em>
591 option of <a href="git-submodule.html">git-submodule(1)</a> does.
592 </p>
593 </dd>
594 <dt class="hdlist1">
595 --color[=&lt;when&gt;]
596 </dt>
597 <dd>
599 Show colored diff.
600 The value must be always (the default), never, or auto.
601 </p>
602 </dd>
603 <dt class="hdlist1">
604 --no-color
605 </dt>
606 <dd>
608 Turn off colored diff, even when the configuration file
609 gives the default to color output.
610 Same as <tt>--color=never</tt>.
611 </p>
612 </dd>
613 <dt class="hdlist1">
614 --word-diff[=&lt;mode&gt;]
615 </dt>
616 <dd>
618 Show a word diff, using the &lt;mode&gt; to delimit changed words.
619 By default, words are delimited by whitespace; see
620 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
621 must be one of:
622 </p>
623 <div class="dlist"><dl>
624 <dt class="hdlist1">
625 color
626 </dt>
627 <dd>
629 Highlight changed words using only colors. Implies <tt>--color</tt>.
630 </p>
631 </dd>
632 <dt class="hdlist1">
633 plain
634 </dt>
635 <dd>
637 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
638 attempts to escape the delimiters if they appear in the input,
639 so the output may be ambiguous.
640 </p>
641 </dd>
642 <dt class="hdlist1">
643 porcelain
644 </dt>
645 <dd>
647 Use a special line-based format intended for script
648 consumption. Added/removed/unchanged runs are printed in the
649 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
650 character at the beginning of the line and extending to the
651 end of the line. Newlines in the input are represented by a
652 tilde <tt>~</tt> on a line of its own.
653 </p>
654 </dd>
655 <dt class="hdlist1">
656 none
657 </dt>
658 <dd>
660 Disable word diff again.
661 </p>
662 </dd>
663 </dl></div>
664 <div class="paragraph"><p>Note that despite the name of the first mode, color is used to
665 highlight the changed parts in all modes if enabled.</p></div>
666 </dd>
667 <dt class="hdlist1">
668 --word-diff-regex=&lt;regex&gt;
669 </dt>
670 <dd>
672 Use &lt;regex&gt; to decide what a word is, instead of considering
673 runs of non-whitespace to be a word. Also implies
674 <tt>--word-diff</tt> unless it was already enabled.
675 </p>
676 <div class="paragraph"><p>Every non-overlapping match of the
677 &lt;regex&gt; is considered a word. Anything between these matches is
678 considered whitespace and ignored(!) for the purposes of finding
679 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
680 expression to make sure that it matches all non-whitespace characters.
681 A match that contains a newline is silently truncated(!) at the
682 newline.</p></div>
683 <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
684 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
685 overrides any diff driver or configuration setting. Diff drivers
686 override configuration settings.</p></div>
687 </dd>
688 <dt class="hdlist1">
689 --color-words[=&lt;regex&gt;]
690 </dt>
691 <dd>
693 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
694 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
695 </p>
696 </dd>
697 <dt class="hdlist1">
698 --no-renames
699 </dt>
700 <dd>
702 Turn off rename detection, even when the configuration
703 file gives the default to do so.
704 </p>
705 </dd>
706 <dt class="hdlist1">
707 --check
708 </dt>
709 <dd>
711 Warn if changes introduce trailing whitespace
712 or an indent that uses a space before a tab. Exits with
713 non-zero status if problems are found. Not compatible with
714 --exit-code.
715 </p>
716 </dd>
717 <dt class="hdlist1">
718 --full-index
719 </dt>
720 <dd>
722 Instead of the first handful of characters, show the full
723 pre- and post-image blob object names on the "index"
724 line when generating patch format output.
725 </p>
726 </dd>
727 <dt class="hdlist1">
728 --binary
729 </dt>
730 <dd>
732 In addition to <tt>--full-index</tt>, output a binary diff that
733 can be applied with <tt>git-apply</tt>.
734 </p>
735 </dd>
736 <dt class="hdlist1">
737 --abbrev[=&lt;n&gt;]
738 </dt>
739 <dd>
741 Instead of showing the full 40-byte hexadecimal object
742 name in diff-raw format output and diff-tree header
743 lines, show only a partial prefix. This is
744 independent of the <tt>--full-index</tt> option above, which controls
745 the diff-patch output format. Non default number of
746 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
747 </p>
748 </dd>
749 <dt class="hdlist1">
750 -B[&lt;n&gt;][/&lt;m&gt;]
751 </dt>
752 <dt class="hdlist1">
753 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
754 </dt>
755 <dd>
757 Break complete rewrite changes into pairs of delete and
758 create. This serves two purposes:
759 </p>
760 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
761 not as a series of deletion and insertion mixed together with a very
762 few lines that happen to match textually as the context, but as a
763 single deletion of everything old followed by a single insertion of
764 everything new, and the number <tt>m</tt> controls this aspect of the -B
765 option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
766 original should remain in the result for git to consider it a total
767 rewrite (i.e. otherwise the resulting patch will be a series of
768 deletion and insertion mixed together with context lines).</p></div>
769 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
770 source of a rename (usually -M only considers a file that disappeared
771 as the source of a rename), and the number <tt>n</tt> controls this aspect of
772 the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
773 addition and deletion compared to 20% or more of the file&#8217;s size are
774 eligible for being picked up as a possible source of a rename to
775 another file.</p></div>
776 </dd>
777 <dt class="hdlist1">
778 -M[&lt;n&gt;]
779 </dt>
780 <dt class="hdlist1">
781 --find-renames[=&lt;n&gt;]
782 </dt>
783 <dd>
785 Detect renames.
786 If <tt>n</tt> is specified, it is a is a threshold on the similarity
787 index (i.e. amount of addition/deletions compared to the
788 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
789 delete/add pair to be a rename if more than 90% of the file
790 hasn&#8217;t changed.
791 </p>
792 </dd>
793 <dt class="hdlist1">
794 -C[&lt;n&gt;]
795 </dt>
796 <dt class="hdlist1">
797 --find-copies[=&lt;n&gt;]
798 </dt>
799 <dd>
801 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
802 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
803 </p>
804 </dd>
805 <dt class="hdlist1">
806 --find-copies-harder
807 </dt>
808 <dd>
810 For performance reasons, by default, <tt>-C</tt> option finds copies only
811 if the original file of the copy was modified in the same
812 changeset. This flag makes the command
813 inspect unmodified files as candidates for the source of
814 copy. This is a very expensive operation for large
815 projects, so use it with caution. Giving more than one
816 <tt>-C</tt> option has the same effect.
817 </p>
818 </dd>
819 <dt class="hdlist1">
820 -l&lt;num&gt;
821 </dt>
822 <dd>
824 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
825 is the number of potential rename/copy targets. This
826 option prevents rename/copy detection from running if
827 the number of rename/copy targets exceeds the specified
828 number.
829 </p>
830 </dd>
831 <dt class="hdlist1">
832 --diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
833 </dt>
834 <dd>
836 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
837 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
838 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
839 are Unmerged (<tt>U</tt>), are
840 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
841 Any combination of the filter characters (including none) can be used.
842 When <tt>*</tt> (All-or-none) is added to the combination, all
843 paths are selected if there is any file that matches
844 other criteria in the comparison; if there is no file
845 that matches other criteria, nothing is selected.
846 </p>
847 </dd>
848 <dt class="hdlist1">
849 -S&lt;string&gt;
850 </dt>
851 <dd>
853 Look for differences that introduce or remove an instance of
854 &lt;string&gt;. Note that this is different than the string simply
855 appearing in diff output; see the <em>pickaxe</em> entry in
856 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
857 </p>
858 </dd>
859 <dt class="hdlist1">
860 -G&lt;regex&gt;
861 </dt>
862 <dd>
864 Look for differences whose added or removed line matches
865 the given &lt;regex&gt;.
866 </p>
867 </dd>
868 <dt class="hdlist1">
869 --pickaxe-all
870 </dt>
871 <dd>
873 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
874 changeset, not just the files that contain the change
875 in &lt;string&gt;.
876 </p>
877 </dd>
878 <dt class="hdlist1">
879 --pickaxe-regex
880 </dt>
881 <dd>
883 Make the &lt;string&gt; not a plain string but an extended POSIX
884 regex to match.
885 </p>
886 </dd>
887 <dt class="hdlist1">
888 -O&lt;orderfile&gt;
889 </dt>
890 <dd>
892 Output the patch in the order specified in the
893 &lt;orderfile&gt;, which has one shell glob pattern per line.
894 </p>
895 </dd>
896 <dt class="hdlist1">
898 </dt>
899 <dd>
901 Swap two inputs; that is, show differences from index or
902 on-disk file to tree contents.
903 </p>
904 </dd>
905 <dt class="hdlist1">
906 --relative[=&lt;path&gt;]
907 </dt>
908 <dd>
910 When run from a subdirectory of the project, it can be
911 told to exclude changes outside the directory and show
912 pathnames relative to it with this option. When you are
913 not in a subdirectory (e.g. in a bare repository), you
914 can name which subdirectory to make the output relative
915 to by giving a &lt;path&gt; as an argument.
916 </p>
917 </dd>
918 <dt class="hdlist1">
920 </dt>
921 <dt class="hdlist1">
922 --text
923 </dt>
924 <dd>
926 Treat all files as text.
927 </p>
928 </dd>
929 <dt class="hdlist1">
930 --ignore-space-at-eol
931 </dt>
932 <dd>
934 Ignore changes in whitespace at EOL.
935 </p>
936 </dd>
937 <dt class="hdlist1">
939 </dt>
940 <dt class="hdlist1">
941 --ignore-space-change
942 </dt>
943 <dd>
945 Ignore changes in amount of whitespace. This ignores whitespace
946 at line end, and considers all other sequences of one or
947 more whitespace characters to be equivalent.
948 </p>
949 </dd>
950 <dt class="hdlist1">
952 </dt>
953 <dt class="hdlist1">
954 --ignore-all-space
955 </dt>
956 <dd>
958 Ignore whitespace when comparing lines. This ignores
959 differences even if one line has whitespace where the other
960 line has none.
961 </p>
962 </dd>
963 <dt class="hdlist1">
964 --inter-hunk-context=&lt;lines&gt;
965 </dt>
966 <dd>
968 Show the context between diff hunks, up to the specified number
969 of lines, thereby fusing hunks that are close to each other.
970 </p>
971 </dd>
972 <dt class="hdlist1">
973 --exit-code
974 </dt>
975 <dd>
977 Make the program exit with codes similar to diff(1).
978 That is, it exits with 1 if there were differences and
979 0 means no differences.
980 </p>
981 </dd>
982 <dt class="hdlist1">
983 --quiet
984 </dt>
985 <dd>
987 Disable all output of the program. Implies <tt>--exit-code</tt>.
988 </p>
989 </dd>
990 <dt class="hdlist1">
991 --ext-diff
992 </dt>
993 <dd>
995 Allow an external diff helper to be executed. If you set an
996 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
997 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
998 </p>
999 </dd>
1000 <dt class="hdlist1">
1001 --no-ext-diff
1002 </dt>
1003 <dd>
1005 Disallow external diff drivers.
1006 </p>
1007 </dd>
1008 <dt class="hdlist1">
1009 --ignore-submodules[=&lt;when&gt;]
1010 </dt>
1011 <dd>
1013 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
1014 either "none", "untracked", "dirty" or "all", which is the default
1015 Using "none" will consider the submodule modified when it either contains
1016 untracked or modified files or its HEAD differs from the commit recorded
1017 in the superproject and can be used to override any settings of the
1018 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
1019 "untracked" is used submodules are not considered dirty when they only
1020 contain untracked content (but they are still scanned for modified
1021 content). Using "dirty" ignores all changes to the work tree of submodules,
1022 only changes to the commits stored in the superproject are shown (this was
1023 the behavior until 1.7.0). Using "all" hides all changes to submodules.
1024 </p>
1025 </dd>
1026 <dt class="hdlist1">
1027 --src-prefix=&lt;prefix&gt;
1028 </dt>
1029 <dd>
1031 Show the given source prefix instead of "a/".
1032 </p>
1033 </dd>
1034 <dt class="hdlist1">
1035 --dst-prefix=&lt;prefix&gt;
1036 </dt>
1037 <dd>
1039 Show the given destination prefix instead of "b/".
1040 </p>
1041 </dd>
1042 <dt class="hdlist1">
1043 --no-prefix
1044 </dt>
1045 <dd>
1047 Do not show any source or destination prefix.
1048 </p>
1049 </dd>
1050 </dl></div>
1051 <div class="paragraph"><p>For more detailed explanation on these common options, see also
1052 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
1053 <div class="dlist"><dl>
1054 <dt class="hdlist1">
1055 -1 --base
1056 </dt>
1057 <dt class="hdlist1">
1058 -2 --ours
1059 </dt>
1060 <dt class="hdlist1">
1061 -3 --theirs
1062 </dt>
1063 <dt class="hdlist1">
1065 </dt>
1066 <dd>
1068 Diff against the "base" version, "our branch" or "their
1069 branch" respectively. With these options, diffs for
1070 merged entries are not shown.
1071 </p>
1072 <div class="paragraph"><p>The default is to diff against our branch (-2) and the
1073 cleanly resolved paths. The option -0 can be given to
1074 omit diff output for unmerged entries and just show "Unmerged".</p></div>
1075 </dd>
1076 <dt class="hdlist1">
1078 </dt>
1079 <dt class="hdlist1">
1080 --cc
1081 </dt>
1082 <dd>
1084 This compares stage 2 (our branch), stage 3 (their
1085 branch) and the working tree file and outputs a combined
1086 diff, similar to the way <em>diff-tree</em> shows a merge
1087 commit with these flags.
1088 </p>
1089 </dd>
1090 <dt class="hdlist1">
1092 </dt>
1093 <dd>
1095 Remain silent even on nonexistent files
1096 </p>
1097 </dd>
1098 </dl></div>
1099 </div>
1100 <h2 id="_raw_output_format">Raw output format</h2>
1101 <div class="sectionbody">
1102 <div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
1103 "git-diff-files" and "git diff --raw" are very similar.</p></div>
1104 <div class="paragraph"><p>These commands all compare two sets of things; what is
1105 compared differs:</p></div>
1106 <div class="dlist"><dl>
1107 <dt class="hdlist1">
1108 git-diff-index &lt;tree-ish&gt;
1109 </dt>
1110 <dd>
1112 compares the &lt;tree-ish&gt; and the files on the filesystem.
1113 </p>
1114 </dd>
1115 <dt class="hdlist1">
1116 git-diff-index --cached &lt;tree-ish&gt;
1117 </dt>
1118 <dd>
1120 compares the &lt;tree-ish&gt; and the index.
1121 </p>
1122 </dd>
1123 <dt class="hdlist1">
1124 git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1125 </dt>
1126 <dd>
1128 compares the trees named by the two arguments.
1129 </p>
1130 </dd>
1131 <dt class="hdlist1">
1132 git-diff-files [&lt;pattern&gt;&#8230;]
1133 </dt>
1134 <dd>
1136 compares the index and the files on the filesystem.
1137 </p>
1138 </dd>
1139 </dl></div>
1140 <div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
1141 what is being compared. After that, all the commands print one output
1142 line per changed file.</p></div>
1143 <div class="paragraph"><p>An output line is formatted this way:</p></div>
1144 <div class="listingblock">
1145 <div class="content">
1146 <pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
1147 copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1148 rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1149 create :000000 100644 0000000... 1234567... A file4
1150 delete :100644 000000 1234567... 0000000... D file5
1151 unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
1152 </div></div>
1153 <div class="paragraph"><p>That is, from the left to the right:</p></div>
1154 <div class="olist arabic"><ol class="arabic">
1155 <li>
1157 a colon.
1158 </p>
1159 </li>
1160 <li>
1162 mode for "src"; 000000 if creation or unmerged.
1163 </p>
1164 </li>
1165 <li>
1167 a space.
1168 </p>
1169 </li>
1170 <li>
1172 mode for "dst"; 000000 if deletion or unmerged.
1173 </p>
1174 </li>
1175 <li>
1177 a space.
1178 </p>
1179 </li>
1180 <li>
1182 sha1 for "src"; 0{40} if creation or unmerged.
1183 </p>
1184 </li>
1185 <li>
1187 a space.
1188 </p>
1189 </li>
1190 <li>
1192 sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1193 </p>
1194 </li>
1195 <li>
1197 a space.
1198 </p>
1199 </li>
1200 <li>
1202 status, followed by optional "score" number.
1203 </p>
1204 </li>
1205 <li>
1207 a tab or a NUL when <em>-z</em> option is used.
1208 </p>
1209 </li>
1210 <li>
1212 path for "src"
1213 </p>
1214 </li>
1215 <li>
1217 a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1218 </p>
1219 </li>
1220 <li>
1222 path for "dst"; only exists for C or R.
1223 </p>
1224 </li>
1225 <li>
1227 an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1228 </p>
1229 </li>
1230 </ol></div>
1231 <div class="paragraph"><p>Possible status letters are:</p></div>
1232 <div class="ulist"><ul>
1233 <li>
1235 A: addition of a file
1236 </p>
1237 </li>
1238 <li>
1240 C: copy of a file into a new one
1241 </p>
1242 </li>
1243 <li>
1245 D: deletion of a file
1246 </p>
1247 </li>
1248 <li>
1250 M: modification of the contents or mode of a file
1251 </p>
1252 </li>
1253 <li>
1255 R: renaming of a file
1256 </p>
1257 </li>
1258 <li>
1260 T: change in the type of the file
1261 </p>
1262 </li>
1263 <li>
1265 U: file is unmerged (you must complete the merge before it can
1266 be committed)
1267 </p>
1268 </li>
1269 <li>
1271 X: "unknown" change type (most probably a bug, please report it)
1272 </p>
1273 </li>
1274 </ul></div>
1275 <div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
1276 percentage of similarity between the source and target of the move or
1277 copy), and are the only ones to be so.</p></div>
1278 <div class="paragraph"><p>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem
1279 and it is out of sync with the index.</p></div>
1280 <div class="paragraph"><p>Example:</p></div>
1281 <div class="listingblock">
1282 <div class="content">
1283 <pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
1284 </div></div>
1285 <div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
1286 in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
1287 respectively.</p></div>
1288 </div>
1289 <h2 id="_diff_format_for_merges">diff format for merges</h2>
1290 <div class="sectionbody">
1291 <div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
1292 can take <em>-c</em> or <em>--cc</em> option
1293 to generate diff output also for merge commits. The output differs
1294 from the format described above in the following way:</p></div>
1295 <div class="olist arabic"><ol class="arabic">
1296 <li>
1298 there is a colon for each parent
1299 </p>
1300 </li>
1301 <li>
1303 there are more "src" modes and "src" sha1
1304 </p>
1305 </li>
1306 <li>
1308 status is concatenated status characters for each parent
1309 </p>
1310 </li>
1311 <li>
1313 no optional "score" number
1314 </p>
1315 </li>
1316 <li>
1318 single path, only for "dst"
1319 </p>
1320 </li>
1321 </ol></div>
1322 <div class="paragraph"><p>Example:</p></div>
1323 <div class="listingblock">
1324 <div class="content">
1325 <pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
1326 </div></div>
1327 <div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
1328 all parents.</p></div>
1329 </div>
1330 <h2 id="_generating_patches_with_p">Generating patches with -p</h2>
1331 <div class="sectionbody">
1332 <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
1333 with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1334 "git log" with the "-p" option, they
1335 do not produce the output described above; instead they produce a
1336 patch file. You can customize the creation of such patches via the
1337 GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
1338 <div class="paragraph"><p>What the -p option produces is slightly different from the traditional
1339 diff format:</p></div>
1340 <div class="olist arabic"><ol class="arabic">
1341 <li>
1343 It is preceded with a "git diff" header that looks like this:
1344 </p>
1345 <div class="literalblock">
1346 <div class="content">
1347 <pre><tt>diff --git a/file1 b/file2</tt></pre>
1348 </div></div>
1349 <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
1350 involved. Especially, even for a creation or a deletion,
1351 <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
1352 <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
1353 name of the source file of the rename/copy and the name of
1354 the file that rename/copy produces, respectively.</p></div>
1355 </li>
1356 <li>
1358 It is followed by one or more extended header lines:
1359 </p>
1360 <div class="literalblock">
1361 <div class="content">
1362 <pre><tt>old mode &lt;mode&gt;
1363 new mode &lt;mode&gt;
1364 deleted file mode &lt;mode&gt;
1365 new file mode &lt;mode&gt;
1366 copy from &lt;path&gt;
1367 copy to &lt;path&gt;
1368 rename from &lt;path&gt;
1369 rename to &lt;path&gt;
1370 similarity index &lt;number&gt;
1371 dissimilarity index &lt;number&gt;
1372 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
1373 </div></div>
1374 <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
1375 and file permission bits.</p></div>
1376 <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
1377 <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
1378 the dissimilarity index is the percentage of changed lines. It
1379 is a rounded down integer, followed by a percent sign. The
1380 similarity index value of 100% is thus reserved for two equal
1381 files, while 100% dissimilarity means that no line from the old
1382 file made it into the new one.</p></div>
1383 <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
1384 The &lt;mode&gt; is included if the file mode does not change; otherwise,
1385 separate lines indicate the old and the new mode.</p></div>
1386 </li>
1387 <li>
1389 TAB, LF, double quote and backslash characters in pathnames
1390 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
1391 If there is need for such substitution then the whole
1392 pathname is put in double quotes.
1393 </p>
1394 </li>
1395 <li>
1397 All the <tt>file1</tt> files in the output refer to files before the
1398 commit, and all the <tt>file2</tt> files refer to files after the commit.
1399 It is incorrect to apply each change to each file sequentially. For
1400 example, this patch will swap a and b:
1401 </p>
1402 <div class="literalblock">
1403 <div class="content">
1404 <pre><tt>diff --git a/a b/b
1405 rename from a
1406 rename to b
1407 diff --git a/b b/a
1408 rename from b
1409 rename to a</tt></pre>
1410 </div></div>
1411 </li>
1412 </ol></div>
1413 </div>
1414 <h2 id="_combined_diff_format">combined diff format</h2>
1415 <div class="sectionbody">
1416 <div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
1417 produce a <em>combined diff</em> when showing a merge. This is the default
1418 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
1419 <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
1420 of these commands to force generation of diffs with individual parents
1421 of a merge.</p></div>
1422 <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
1423 <div class="listingblock">
1424 <div class="content">
1425 <pre><tt>diff --combined describe.c
1426 index fabadb8,cc95eb0..4866510
1427 --- a/describe.c
1428 +++ b/describe.c
1429 @@@ -98,20 -98,12 +98,20 @@@
1430 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
1433 - static void describe(char *arg)
1434 -static void describe(struct commit *cmit, int last_one)
1435 ++static void describe(char *arg, int last_one)
1437 + unsigned char sha1[20];
1438 + struct commit *cmit;
1439 struct commit_list *list;
1440 static int initialized = 0;
1441 struct commit_name *n;
1443 + if (get_sha1(arg, sha1) &lt; 0)
1444 + usage(describe_usage);
1445 + cmit = lookup_commit_reference(sha1);
1446 + if (!cmit)
1447 + usage(describe_usage);
1449 if (!initialized) {
1450 initialized = 1;
1451 for_each_ref(get_name);</tt></pre>
1452 </div></div>
1453 <div class="olist arabic"><ol class="arabic">
1454 <li>
1456 It is preceded with a "git diff" header, that looks like
1457 this (when <em>-c</em> option is used):
1458 </p>
1459 <div class="literalblock">
1460 <div class="content">
1461 <pre><tt>diff --combined file</tt></pre>
1462 </div></div>
1463 <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
1464 <div class="literalblock">
1465 <div class="content">
1466 <pre><tt>diff --cc file</tt></pre>
1467 </div></div>
1468 </li>
1469 <li>
1471 It is followed by one or more extended header lines
1472 (this example shows a merge with two parents):
1473 </p>
1474 <div class="literalblock">
1475 <div class="content">
1476 <pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
1477 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
1478 new file mode &lt;mode&gt;
1479 deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
1480 </div></div>
1481 <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
1482 the &lt;mode&gt; is different from the rest. Extended headers with
1483 information about detected contents movement (renames and
1484 copying detection) are designed to work with diff of two
1485 &lt;tree-ish&gt; and are not used by combined diff format.</p></div>
1486 </li>
1487 <li>
1489 It is followed by two-line from-file/to-file header
1490 </p>
1491 <div class="literalblock">
1492 <div class="content">
1493 <pre><tt>--- a/file
1494 +++ b/file</tt></pre>
1495 </div></div>
1496 <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
1497 format, <tt>/dev/null</tt> is used to signal created or deleted
1498 files.</p></div>
1499 </li>
1500 <li>
1502 Chunk header format is modified to prevent people from
1503 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
1504 was created for review of merge commit changes, and was not
1505 meant for apply. The change is similar to the change in the
1506 extended <em>index</em> header:
1507 </p>
1508 <div class="literalblock">
1509 <div class="content">
1510 <pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
1511 </div></div>
1512 <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
1513 header for combined diff format.</p></div>
1514 </li>
1515 </ol></div>
1516 <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
1517 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
1518 added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
1519 compares two or more files file1, file2,&#8230; with one file X, and
1520 shows how X differs from each of fileN. One column for each of
1521 fileN is prepended to the output line to note how X&#8217;s line is
1522 different from it.</p></div>
1523 <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
1524 fileN but it does not appear in the result. A <tt>+</tt> character
1525 in the column N means that the line appears in the result,
1526 and fileN does not have that line (in other words, the line was
1527 added, from the point of view of that parent).</p></div>
1528 <div class="paragraph"><p>In the above example output, the function signature was changed
1529 from both files (hence two <tt>-</tt> removals from both file1 and
1530 file2, plus <tt>++</tt> to mean one line that was added does not appear
1531 in either file1 nor file2). Also eight other lines are the same
1532 from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
1533 <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
1534 merge commit with the merge result (i.e. file1..fileN are the
1535 parents). When shown by <tt>git diff-files -c</tt>, it compares the
1536 two unresolved merge parents with the working tree file
1537 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
1538 "their version").</p></div>
1539 </div>
1540 <h2 id="_other_diff_formats">other diff formats</h2>
1541 <div class="sectionbody">
1542 <div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
1543 copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
1544 output. These options can be combined with other options, such as
1545 <tt>-p</tt>, and are meant for human consumption.</p></div>
1546 <div class="paragraph"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output
1547 formats the pathnames compactly by combining common prefix and suffix of
1548 the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
1549 <tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
1550 <div class="listingblock">
1551 <div class="content">
1552 <pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
1553 </div></div>
1554 <div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
1555 for easier machine consumption. An entry in <tt>--numstat</tt> output looks
1556 like this:</p></div>
1557 <div class="listingblock">
1558 <div class="content">
1559 <pre><tt>1 2 README
1560 3 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
1561 </div></div>
1562 <div class="paragraph"><p>That is, from left to right:</p></div>
1563 <div class="olist arabic"><ol class="arabic">
1564 <li>
1566 the number of added lines;
1567 </p>
1568 </li>
1569 <li>
1571 a tab;
1572 </p>
1573 </li>
1574 <li>
1576 the number of deleted lines;
1577 </p>
1578 </li>
1579 <li>
1581 a tab;
1582 </p>
1583 </li>
1584 <li>
1586 pathname (possibly with rename/copy information);
1587 </p>
1588 </li>
1589 <li>
1591 a newline.
1592 </p>
1593 </li>
1594 </ol></div>
1595 <div class="paragraph"><p>When <tt>-z</tt> output option is in effect, the output is formatted this way:</p></div>
1596 <div class="listingblock">
1597 <div class="content">
1598 <pre><tt>1 2 README NUL
1599 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
1600 </div></div>
1601 <div class="paragraph"><p>That is:</p></div>
1602 <div class="olist arabic"><ol class="arabic">
1603 <li>
1605 the number of added lines;
1606 </p>
1607 </li>
1608 <li>
1610 a tab;
1611 </p>
1612 </li>
1613 <li>
1615 the number of deleted lines;
1616 </p>
1617 </li>
1618 <li>
1620 a tab;
1621 </p>
1622 </li>
1623 <li>
1625 a NUL (only exists if renamed/copied);
1626 </p>
1627 </li>
1628 <li>
1630 pathname in preimage;
1631 </p>
1632 </li>
1633 <li>
1635 a NUL (only exists if renamed/copied);
1636 </p>
1637 </li>
1638 <li>
1640 pathname in postimage (only exists if renamed/copied);
1641 </p>
1642 </li>
1643 <li>
1645 a NUL.
1646 </p>
1647 </li>
1648 </ol></div>
1649 <div class="paragraph"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow
1650 scripts that read the output to tell if the current record being read is
1651 a single-path record or a rename/copy record without reading ahead.
1652 After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
1653 the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
1654 </div>
1655 <h2 id="_git">GIT</h2>
1656 <div class="sectionbody">
1657 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1658 </div>
1659 <div id="footer">
1660 <div id="footer-text">
1661 Last updated 2011-03-15 23:30:13 UTC
1662 </div>
1663 </div>
1664 </body>
1665 </html>