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