blob: addaa38e3b66814ab5be0b8cc59bae00e9a7a1c4 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!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" />
Junio C Hamano01078922006-03-10 00:31:476<meta name="generator" content="AsciiDoc 7.0.2" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-diff(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-diff(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-diff -
Junio C Hamano01078922006-03-10 00:31:47269 Show changes between commits, commit and working tree, etc
Junio C Hamano1a4e8412005-12-27 08:17:23270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
Junio C Hamano60f8aa82007-03-06 09:58:26275<p><em>git-diff</em> [&lt;common diff options&gt;] &lt;commit&gt;{0,2} [--] [&lt;path&gt;&#8230;]</p>
Junio C Hamano1a4e8412005-12-27 08:17:23276</div>
277<h2>DESCRIPTION</h2>
278<div class="sectionbody">
Junio C Hamano51c2ab02006-07-09 20:38:54279<p>Show changes between two trees, a tree and the working tree, a
Junio C Hamano47848ae2006-12-14 11:20:06280tree and the index file, or the index file and the working tree.</p>
281<dl>
282<dt>
283<em>git-diff</em> [--options] [--] [&lt;path&gt;&#8230;]
284</dt>
285<dd>
Junio C Hamano1a4e8412005-12-27 08:17:23286<p>
Junio C Hamano47848ae2006-12-14 11:20:06287 This form is to view the changes you made relative to
288 the index (staging area for the next commit). In other
289 words, the differences are what you _could_ tell git to
290 further add to the index but you still haven't. You can
291 stage these changes by using <a href="git-add.html">git-add(1)</a>.
Junio C Hamano1a4e8412005-12-27 08:17:23292</p>
Junio C Hamanodb911ee2007-02-28 08:13:52293<div class="literalblock">
294<div class="content">
295<pre><tt>If exactly two paths are given, and at least one is untracked,
296compare the two files / directories. This behavior can be
297forced by --no-index.</tt></pre>
298</div></div>
Junio C Hamano47848ae2006-12-14 11:20:06299</dd>
300<dt>
301<em>git-diff</em> [--options] --cached [&lt;commit&gt;] [--] [&lt;path&gt;&#8230;]
302</dt>
303<dd>
Junio C Hamano1a4e8412005-12-27 08:17:23304<p>
Junio C Hamano47848ae2006-12-14 11:20:06305 This form is to view the changes you staged for the next
Junio C Hamano4bf6dca2006-12-21 02:25:57306 commit relative to the named &lt;commit&gt;. Typically you
Junio C Hamano47848ae2006-12-14 11:20:06307 would want comparison with the latest commit, so if you
308 do not give &lt;commit&gt;, it defaults to HEAD.
Junio C Hamano1a4e8412005-12-27 08:17:23309</p>
Junio C Hamano47848ae2006-12-14 11:20:06310</dd>
311<dt>
Junio C Hamano7d23f5e2006-12-16 07:44:04312<em>git-diff</em> [--options] &lt;commit&gt; [--] [&lt;path&gt;&#8230;]
Junio C Hamano47848ae2006-12-14 11:20:06313</dt>
314<dd>
Junio C Hamano1a4e8412005-12-27 08:17:23315<p>
Junio C Hamano47848ae2006-12-14 11:20:06316 This form is to view the changes you have in your
317 working tree relative to the named &lt;commit&gt;. You can
318 use HEAD to compare it with the latest commit, or a
319 branch name to compare with the tip of a different
320 branch.
Junio C Hamano1a4e8412005-12-27 08:17:23321</p>
Junio C Hamano47848ae2006-12-14 11:20:06322</dd>
323<dt>
Junio C Hamano7d23f5e2006-12-16 07:44:04324<em>git-diff</em> [--options] &lt;commit&gt; &lt;commit&gt; [--] [&lt;path&gt;&#8230;]
Junio C Hamano47848ae2006-12-14 11:20:06325</dt>
326<dd>
327<p>
328 This form is to view the changes between two &lt;commit&gt;,
329 for example, tips of two branches.
330</p>
331</dd>
332</dl>
333<p>Just in case if you are doing something exotic, it should be
334noted that all of the &lt;commit&gt; in the above description can be
335any &lt;tree-ish&gt;.</p>
Junio C Hamano2d47c622007-01-18 06:24:10336<p>For a more complete list of ways to spell &lt;commit&gt;, see
337"SPECIFYING REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>.</p>
Junio C Hamano1a4e8412005-12-27 08:17:23338</div>
339<h2>OPTIONS</h2>
340<div class="sectionbody">
341<dl>
342<dt>
Junio C Hamano47848ae2006-12-14 11:20:06343-p
Junio C Hamano1a4e8412005-12-27 08:17:23344</dt>
345<dd>
346<p>
Junio C Hamano47848ae2006-12-14 11:20:06347 Generate patch (see section on generating patches)
Junio C Hamano1a4e8412005-12-27 08:17:23348</p>
349</dd>
350<dt>
Junio C Hamano47848ae2006-12-14 11:20:06351-u
352</dt>
353<dd>
354<p>
355 Synonym for "-p".
356</p>
357</dd>
358<dt>
Junio C Hamano69361562007-07-26 02:14:34359-U&lt;n&gt;
360</dt>
361<dd>
362<p>
363 Shorthand for "--unified=&lt;n&gt;".
364</p>
365</dd>
366<dt>
367--unified=&lt;n&gt;
368</dt>
369<dd>
370<p>
371 Generate diffs with &lt;n&gt; lines of context instead of
372 the usual three. Implies "-p".
373</p>
374</dd>
375<dt>
Junio C Hamano47848ae2006-12-14 11:20:06376--raw
377</dt>
378<dd>
379<p>
380 Generate the raw format.
381</p>
382</dd>
383<dt>
384--patch-with-raw
385</dt>
386<dd>
387<p>
388 Synonym for "-p --raw".
389</p>
390</dd>
391<dt>
392--stat[=width[,name-width]]
393</dt>
394<dd>
395<p>
396 Generate a diffstat. You can override the default
397 output width for 80-column terminal by "--stat=width".
398 The width of the filename part can be controlled by
399 giving another width to it separated by a comma.
400</p>
401</dd>
402<dt>
403--numstat
404</dt>
405<dd>
406<p>
407 Similar to --stat, but shows number of added and
408 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43409 abbreviation, to make it more machine friendly. For
410 binary files, outputs two <tt>-</tt> instead of saying
411 <tt>0 0</tt>.
Junio C Hamano47848ae2006-12-14 11:20:06412</p>
413</dd>
414<dt>
Junio C Hamano7d23f5e2006-12-16 07:44:04415--shortstat
416</dt>
417<dd>
418<p>
419 Output only the last line of the --stat format containing total
420 number of modified files, as well as number of added and deleted
421 lines.
422</p>
423</dd>
424<dt>
Junio C Hamano47848ae2006-12-14 11:20:06425--summary
426</dt>
427<dd>
428<p>
429 Output a condensed summary of extended header information
430 such as creations, renames and mode changes.
431</p>
432</dd>
433<dt>
434--patch-with-stat
435</dt>
436<dd>
437<p>
438 Synonym for "-p --stat".
439</p>
440</dd>
441<dt>
442-z
443</dt>
444<dd>
445<p>
Junio C Hamanob968dbb2007-07-27 07:26:40446 NUL-line termination on output. This affects the --raw
447 output field terminator. Also output from commands such
448 as "git-log" will be delimited with NUL between commits.
Junio C Hamano47848ae2006-12-14 11:20:06449</p>
450</dd>
451<dt>
452--name-only
453</dt>
454<dd>
455<p>
456 Show only names of changed files.
457</p>
458</dd>
459<dt>
460--name-status
461</dt>
462<dd>
463<p>
464 Show only names and status of changed files.
465</p>
466</dd>
467<dt>
468--color
469</dt>
470<dd>
471<p>
472 Show colored diff.
473</p>
474</dd>
475<dt>
476--no-color
477</dt>
478<dd>
479<p>
480 Turn off colored diff, even when the configuration file
481 gives the default to color output.
482</p>
483</dd>
484<dt>
485--color-words
486</dt>
487<dd>
488<p>
489 Show colored word diff, i.e. color words which have changed.
490</p>
491</dd>
492<dt>
493--no-renames
494</dt>
495<dd>
496<p>
497 Turn off rename detection, even when the configuration
498 file gives the default to do so.
499</p>
500</dd>
501<dt>
Junio C Hamanoa890c4f2007-01-28 10:29:21502--check
503</dt>
504<dd>
505<p>
506 Warn if changes introduce trailing whitespace
507 or an indent that uses a space before a tab.
508</p>
509</dd>
510<dt>
Junio C Hamano47848ae2006-12-14 11:20:06511--full-index
512</dt>
513<dd>
514<p>
515 Instead of the first handful characters, show full
516 object name of pre- and post-image blob on the "index"
517 line when generating a patch format output.
518</p>
519</dd>
520<dt>
521--binary
522</dt>
523<dd>
524<p>
525 In addition to --full-index, output "binary diff" that
526 can be applied with "git apply".
527</p>
528</dd>
529<dt>
530--abbrev[=&lt;n&gt;]
531</dt>
532<dd>
533<p>
534 Instead of showing the full 40-byte hexadecimal object
535 name in diff-raw format output and diff-tree header
536 lines, show only handful hexdigits prefix. This is
537 independent of --full-index option above, which controls
538 the diff-patch output format. Non default number of
539 digits can be specified with --abbrev=&lt;n&gt;.
540</p>
541</dd>
542<dt>
543-B
544</dt>
545<dd>
546<p>
547 Break complete rewrite changes into pairs of delete and create.
548</p>
549</dd>
550<dt>
551-M
552</dt>
553<dd>
554<p>
555 Detect renames.
556</p>
557</dd>
558<dt>
559-C
560</dt>
561<dd>
562<p>
Junio C Hamano16f98872007-06-12 16:09:14563 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamano47848ae2006-12-14 11:20:06564</p>
565</dd>
566<dt>
567--diff-filter=[ACDMRTUXB*]
568</dt>
569<dd>
570<p>
571 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
572 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
573 type (mode) changed (<tt>T</tt>), are Unmerged (<tt>U</tt>), are
574 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
575 Any combination of the filter characters may be used.
576 When <tt>*</tt> (All-or-none) is added to the combination, all
577 paths are selected if there is any file that matches
578 other criteria in the comparison; if there is no file
579 that matches other criteria, nothing is selected.
580</p>
581</dd>
582<dt>
583--find-copies-harder
584</dt>
585<dd>
586<p>
Junio C Hamano16f98872007-06-12 16:09:14587 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano47848ae2006-12-14 11:20:06588 if the original file of the copy was modified in the same
589 changeset. This flag makes the command
590 inspect unmodified files as candidates for the source of
591 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:14592 projects, so use it with caution. Giving more than one
593 <tt>-C</tt> option has the same effect.
Junio C Hamano47848ae2006-12-14 11:20:06594</p>
595</dd>
596<dt>
597-l&lt;num&gt;
598</dt>
599<dd>
600<p>
601 -M and -C options require O(n^2) processing time where n
602 is the number of potential rename/copy targets. This
603 option prevents rename/copy detection from running if
604 the number of rename/copy targets exceeds the specified
605 number.
606</p>
607</dd>
608<dt>
609-S&lt;string&gt;
610</dt>
611<dd>
612<p>
613 Look for differences that contain the change in &lt;string&gt;.
614</p>
615</dd>
616<dt>
617--pickaxe-all
618</dt>
619<dd>
620<p>
621 When -S finds a change, show all the changes in that
622 changeset, not just the files that contain the change
623 in &lt;string&gt;.
624</p>
625</dd>
626<dt>
627--pickaxe-regex
628</dt>
629<dd>
630<p>
631 Make the &lt;string&gt; not a plain string but an extended POSIX
632 regex to match.
633</p>
634</dd>
635<dt>
636-O&lt;orderfile&gt;
637</dt>
638<dd>
639<p>
640 Output the patch in the order specified in the
641 &lt;orderfile&gt;, which has one shell glob pattern per line.
642</p>
643</dd>
644<dt>
645-R
646</dt>
647<dd>
648<p>
649 Swap two inputs; that is, show differences from index or
650 on-disk file to tree contents.
651</p>
652</dd>
653<dt>
654--text
655</dt>
656<dd>
657<p>
658 Treat all files as text.
659</p>
660</dd>
661<dt>
662-a
663</dt>
664<dd>
665<p>
666 Shorthand for "--text".
667</p>
668</dd>
669<dt>
Junio C Hamanofd468962007-02-14 23:45:04670--ignore-space-at-eol
671</dt>
672<dd>
673<p>
674 Ignore changes in white spaces at EOL.
675</p>
676</dd>
677<dt>
Junio C Hamano47848ae2006-12-14 11:20:06678--ignore-space-change
679</dt>
680<dd>
681<p>
682 Ignore changes in amount of white space. This ignores white
683 space at line end, and consider all other sequences of one or
684 more white space characters to be equivalent.
685</p>
686</dd>
687<dt>
688-b
689</dt>
690<dd>
691<p>
692 Shorthand for "--ignore-space-change".
693</p>
694</dd>
695<dt>
696--ignore-all-space
697</dt>
698<dd>
699<p>
700 Ignore white space when comparing lines. This ignores
701 difference even if one line has white space where the other
702 line has none.
703</p>
704</dd>
705<dt>
706-w
707</dt>
708<dd>
709<p>
710 Shorthand for "--ignore-all-space".
711</p>
712</dd>
Junio C Hamano48fd2f62007-03-19 02:02:30713<dt>
714--exit-code
715</dt>
716<dd>
717<p>
718 Make the program exit with codes similar to diff(1).
719 That is, it exits with 1 if there were differences and
720 0 means no differences.
721</p>
722</dd>
Junio C Hamano35e57552007-03-25 07:54:35723<dt>
724--quiet
725</dt>
726<dd>
727<p>
728 Disable all output of the program. Implies --exit-code.
729</p>
730</dd>
Junio C Hamanobb0f4042007-07-04 06:41:40731<dt>
732--ext-diff
733</dt>
734<dd>
735<p>
736 Allow an external diff helper to be executed. If you set an
737 external diff driver with gitlink:gitattributes(5), you need
738 to use this option with gitlink:git-log(1) and friends.
739</p>
740</dd>
741<dt>
742--no-ext-diff
743</dt>
744<dd>
745<p>
746 Disallow external diff drivers.
747</p>
748</dd>
Junio C Hamano47848ae2006-12-14 11:20:06749</dl>
750<p>For more detailed explanation on these common options, see also
751<a href="diffcore.html">diffcore documentation</a>.</p>
752<dl>
753<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23754&lt;path&gt;&#8230;
755</dt>
756<dd>
757<p>
Junio C Hamano47848ae2006-12-14 11:20:06758 The &lt;paths&gt; parameters, when given, are used to limit
759 the diff to the named paths (you can give directory
760 names and get diff for all files under them).
Junio C Hamano1a4e8412005-12-27 08:17:23761</p>
762</dd>
763</dl>
764</div>
765<h2>EXAMPLES</h2>
766<div class="sectionbody">
767<dl>
768<dt>
769Various ways to check your working tree
770</dt>
771<dd>
772<div class="listingblock">
773<div class="content">
Junio C Hamanoc8d88c22006-04-29 07:02:01774<pre><tt>$ git diff <b>(1)</b>
Junio C Hamano47848ae2006-12-14 11:20:06775$ git diff --cached <b>(2)</b>
Junio C Hamanoc8d88c22006-04-29 07:02:01776$ git diff HEAD <b>(3)</b></tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23777</div></div>
Junio C Hamanoc8d88c22006-04-29 07:02:01778<ol>
779<li>
780<p>
Junio C Hamano092f5f02007-08-02 07:23:38781Changes in the working tree not yet staged for the next commit.
Junio C Hamanoc8d88c22006-04-29 07:02:01782</p>
783</li>
784<li>
785<p>
Junio C Hamano092f5f02007-08-02 07:23:38786Changes between the index and your last commit; what you
Junio C Hamanoc8d88c22006-04-29 07:02:01787would be committing if you run "git commit" without "-a" option.
788</p>
789</li>
790<li>
791<p>
Junio C Hamano092f5f02007-08-02 07:23:38792Changes in the working tree since your last commit; what you
Junio C Hamanoc8d88c22006-04-29 07:02:01793would be committing if you run "git commit -a"
794</p>
795</li>
796</ol>
Junio C Hamano1a4e8412005-12-27 08:17:23797</dd>
798<dt>
799Comparing with arbitrary commits
800</dt>
801<dd>
802<div class="listingblock">
803<div class="content">
Junio C Hamanoc8d88c22006-04-29 07:02:01804<pre><tt>$ git diff test <b>(1)</b>
805$ git diff HEAD -- ./test <b>(2)</b>
806$ git diff HEAD^ HEAD <b>(3)</b></tt></pre>
807</div></div>
808<ol>
809<li>
810<p>
Junio C Hamano092f5f02007-08-02 07:23:38811Instead of using the tip of the current branch, compare with the
Junio C Hamano1a4e8412005-12-27 08:17:23812tip of "test" branch.
Junio C Hamanoc8d88c22006-04-29 07:02:01813</p>
814</li>
815<li>
816<p>
Junio C Hamano092f5f02007-08-02 07:23:38817Instead of comparing with the tip of "test" branch, compare with
Junio C Hamano235a91e2006-01-07 01:13:58818the tip of the current branch, but limit the comparison to the
Junio C Hamano1a4e8412005-12-27 08:17:23819file "test".
Junio C Hamanoc8d88c22006-04-29 07:02:01820</p>
821</li>
822<li>
823<p>
Junio C Hamano092f5f02007-08-02 07:23:38824Compare the version before the last commit and the last commit.
Junio C Hamanoc8d88c22006-04-29 07:02:01825</p>
826</li>
827</ol>
Junio C Hamano1a4e8412005-12-27 08:17:23828</dd>
829<dt>
830Limiting the diff output
831</dt>
832<dd>
833<div class="listingblock">
834<div class="content">
Junio C Hamanoc8d88c22006-04-29 07:02:01835<pre><tt>$ git diff --diff-filter=MRC <b>(1)</b>
Junio C Hamanobdeff822007-07-30 09:07:17836$ git diff --name-status <b>(2)</b>
Junio C Hamanoc8d88c22006-04-29 07:02:01837$ git diff arch/i386 include/asm-i386 <b>(3)</b></tt></pre>
838</div></div>
839<ol>
840<li>
841<p>
Junio C Hamano092f5f02007-08-02 07:23:38842Show only modification, rename and copy, but not addition
Junio C Hamano1a4e8412005-12-27 08:17:23843nor deletion.
Junio C Hamanoc8d88c22006-04-29 07:02:01844</p>
845</li>
846<li>
847<p>
Junio C Hamano092f5f02007-08-02 07:23:38848Show only names and the nature of change, but not actual
Junio C Hamanobdeff822007-07-30 09:07:17849diff output.
Junio C Hamanoc8d88c22006-04-29 07:02:01850</p>
851</li>
852<li>
853<p>
Junio C Hamano092f5f02007-08-02 07:23:38854Limit diff output to named subtrees.
Junio C Hamanoc8d88c22006-04-29 07:02:01855</p>
856</li>
857</ol>
Junio C Hamano1a4e8412005-12-27 08:17:23858</dd>
859<dt>
860Munging the diff output
861</dt>
862<dd>
863<div class="listingblock">
864<div class="content">
Junio C Hamanoc8d88c22006-04-29 07:02:01865<pre><tt>$ git diff --find-copies-harder -B -C <b>(1)</b>
866$ git diff -R <b>(2)</b></tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23867</div></div>
Junio C Hamanoc8d88c22006-04-29 07:02:01868<ol>
869<li>
870<p>
Junio C Hamano092f5f02007-08-02 07:23:38871Spend extra cycles to find renames, copies and complete
Junio C Hamanoc8d88c22006-04-29 07:02:01872rewrites (very expensive).
873</p>
874</li>
875<li>
876<p>
Junio C Hamano092f5f02007-08-02 07:23:38877Output diff in reverse.
Junio C Hamanoc8d88c22006-04-29 07:02:01878</p>
879</li>
880</ol>
Junio C Hamano1a4e8412005-12-27 08:17:23881</dd>
882</dl>
883</div>
884<h2>Author</h2>
885<div class="sectionbody">
886<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
887</div>
888<h2>Documentation</h2>
889<div class="sectionbody">
890<p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p>
891</div>
892<h2>GIT</h2>
893<div class="sectionbody">
894<p>Part of the <a href="git.html">git(7)</a> suite</p>
895</div>
896<div id="footer">
897<div id="footer-text">
Junio C Hamano092f5f02007-08-02 07:23:38898Last updated 02-Aug-2007 07:23:08 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23899</div>
900</div>
901</body>
902</html>