blob: 26fd2e0c780fdb20b517271b50d1f074f65a5568 [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 Hamano7bd050f2011-09-22 06:32:226<meta name="generator" content="AsciiDoc 8.5.2" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-diff-files(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
Junio C Hamanoba4b9282008-07-06 05:20:3120a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
Junio C Hamano1a4e8412005-12-27 08:17:2327
28em {
29 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5930 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2331}
32
33strong {
34 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5935 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2336}
37
38tt {
39 color: navy;
40}
41
42h1, 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;
48}
49
Junio C Hamanoba4b9282008-07-06 05:20:3150h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 border-bottom: 2px solid silver;
52}
53h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2354 padding-top: 0.5em;
55}
Junio C Hamanoba4b9282008-07-06 05:20:3156h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
Junio C Hamano1a4e8412005-12-27 08:17:2362
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamano68cf15a2010-11-06 01:01:5977ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamano1a4e8412005-12-27 08:17:2381pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3190 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2391}
92span#email {
93}
Junio C Hamano68cf15a2010-11-06 01:01:5994span#revnumber, span#revdate, span#revremark {
Junio C Hamano1a4e8412005-12-27 08:17:2395 font-family: sans-serif;
96}
97
98div#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;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamano68cf15a2010-11-06 01:01:59114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamano1a4e8412005-12-27 08:17:23118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22121 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23129}
130
131div.content { /* Block element content. */
132 padding: 0;
133}
134
135/* Block element titles. */
136div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59137 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
143}
144div.title + * {
145 margin-top: 0;
146}
147
148td div.title:first-child {
149 margin-top: 0.0em;
150}
151div.content div.title:first-child {
152 margin-top: 0.0em;
153}
154div.content + div.title {
155 margin-top: 0.0em;
156}
157
158div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
162}
163
164div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
168}
169
Junio C Hamano7bd050f2011-09-22 06:32:22170div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59173 margin-right: 10%;
Junio C Hamano7bd050f2011-09-22 06:32:22174 border-left: 5px solid #dddddd;
175 color: #777777;
Junio C Hamano1a4e8412005-12-27 08:17:23176}
Junio C Hamano7bd050f2011-09-22 06:32:22177
Junio C Hamano68cf15a2010-11-06 01:01:59178div.quoteblock > div.attribution {
179 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23180 text-align: right;
181}
Junio C Hamano68cf15a2010-11-06 01:01:59182
Junio C Hamano68cf15a2010-11-06 01:01:59183div.verseblock > div.content {
184 white-space: pre;
185}
186div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
189}
190/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31191div.verseblock + div.attribution {
192 text-align: left;
193}
Junio C Hamano1a4e8412005-12-27 08:17:23194
195div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
202}
203div.admonitionblock td.content {
204 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22205 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23206}
207
208div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23211}
212
Junio C Hamano1a4e8412005-12-27 08:17:23213div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23214span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59215a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23216
217dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
220}
221dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59224 font-style: normal;
225 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59228 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23229}
230
231ul, ol {
232 list-style-position: outside;
233}
Junio C Hamano68cf15a2010-11-06 01:01:59234ol.arabic {
235 list-style-type: decimal;
236}
237ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23238 list-style-type: lower-alpha;
239}
Junio C Hamano68cf15a2010-11-06 01:01:59240ol.upperalpha {
241 list-style-type: upper-alpha;
242}
243ol.lowerroman {
244 list-style-type: lower-roman;
245}
246ol.upperroman {
247 list-style-type: upper-roman;
248}
249
250div.compact ul, div.compact ol,
251div.compact p, div.compact p,
252div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
255}
Junio C Hamano1a4e8412005-12-27 08:17:23256
257div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31258 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23259}
Junio C Hamano7bd050f2011-09-22 06:32:22260thead, p.table.header {
Junio C Hamano1a4e8412005-12-27 08:17:23261 font-family: sans-serif;
262 font-weight: bold;
263}
264tfoot {
265 font-weight: bold;
266}
Junio C Hamano68cf15a2010-11-06 01:01:59267td > div.verse {
268 white-space: pre;
269}
270p.table {
271 margin-top: 0;
272}
273/* Because the table frame attribute is overriden by CSS in most browsers. */
274div.tableblock > table[frame="void"] {
275 border-style: none;
276}
277div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
280}
281div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
284}
Junio C Hamano1a4e8412005-12-27 08:17:23285
Junio C Hamano68cf15a2010-11-06 01:01:59286
287div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
290}
Junio C Hamano68cf15a2010-11-06 01:01:59291div.hdlist tr {
292 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31293}
Junio C Hamano68cf15a2010-11-06 01:01:59294dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
296}
297td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23298 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59299 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23300 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59301 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23302}
Junio C Hamano68cf15a2010-11-06 01:01:59303td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23304 vertical-align: top;
305}
Junio C Hamano68cf15a2010-11-06 01:01:59306div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
309}
310
311.comment {
312 background: yellow;
313}
Junio C Hamano1a4e8412005-12-27 08:17:23314
Junio C Hamano7bd050f2011-09-22 06:32:22315.footnote, .footnoteref {
316 font-size: 0.8em;
317}
318
319span.footnote, span.footnoteref {
320 vertical-align: super;
321}
322
323#footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
326}
327
328#footnotes div.footnote {
329 margin: 0 0 5px 0;
330}
331
332#footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
340}
341
342
Junio C Hamano1a4e8412005-12-27 08:17:23343@media print {
344 div#footer-badges { display: none; }
345}
Junio C Hamanoba4b9282008-07-06 05:20:31346
Junio C Hamano7bd050f2011-09-22 06:32:22347div#toc {
348 margin-bottom: 2.5em;
349}
350
Junio C Hamanoba4b9282008-07-06 05:20:31351div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
358}
359
360div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
363}
364div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
367}
368div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
371}
372div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
375}
Junio C Hamano68cf15a2010-11-06 01:01:59376/* Overrides for manpage documents */
377h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
382}
383h2 {
384 border-style: none;
385}
386div.sectionbody {
387 margin-left: 5%;
388}
389
390@media print {
391 div#toc { display: none; }
392}
393
Junio C Hamano1a4e8412005-12-27 08:17:23394/* Workarounds for IE6's broken and incomplete CSS2. */
395
396div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
400}
401div.sidebar-title, div.image-title {
Junio C Hamano68cf15a2010-11-06 01:01:59402 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
407}
408
409div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
413}
414
Junio C Hamano68cf15a2010-11-06 01:01:59415div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
418}
419
420div.verseblock-content {
421 white-space: pre;
422}
423div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
Junio C Hamano1a4e8412005-12-27 08:17:23426}
427
428div.exampleblock-content {
Junio C Hamano7bd050f2011-09-22 06:32:22429 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23430 padding-left: 0.5em;
431}
Junio C Hamanoba4b9282008-07-06 05:20:31432
433/* IE6 sets dynamically generated links as visited. */
434div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23435</style>
Junio C Hamano7bd050f2011-09-22 06:32:22436<script type="text/javascript">
437/*<![CDATA[*/
438window.onload = function(){asciidoc.footnotes();}
439var asciidoc = { // Namespace.
440
441/////////////////////////////////////////////////////////////////////
442// Table Of Contents generator
443/////////////////////////////////////////////////////////////////////
444
445/* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
447 *
448 * Table Of Content generator
449 * Version: 0.4
450 *
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
453 */
454
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
457
458// toclevels = 1..4.
459toc: function (toclevels) {
460
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
468 }
469 return text;
470 }
471
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
476 }
477
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
490 }
491 iterate(i);
492 }
493 }
494 }
495 iterate(el);
496 return result;
497 }
498
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
512 }
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
515},
516
517
518/////////////////////////////////////////////////////////////////////
519// Footnotes generator
520/////////////////////////////////////////////////////////////////////
521
522/* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
524 */
525
526footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
547 }
548 }
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
561 }
562 }
563 }
564}
565
566}
567/*]]>*/
568</script>
Junio C Hamano1a4e8412005-12-27 08:17:23569</head>
570<body>
571<div id="header">
572<h1>
573git-diff-files(1) Manual Page
574</h1>
575<h2>NAME</h2>
576<div class="sectionbody">
577<p>git-diff-files -
578 Compares files in the working tree and the index
579</p>
580</div>
581</div>
Junio C Hamano7bd050f2011-09-22 06:32:22582<div id="content">
Junio C Hamano68cf15a2010-11-06 01:01:59583<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23584<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59585<div class="verseblock">
586<div class="verseblock-content"><em>git diff-files</em> [-q] [-0|-1|-2|-3|-c|--cc] [&lt;common diff options&gt;] [&lt;path&gt;&#8230;]</div>
587<div class="verseblock-attribution">
588</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23589</div>
Junio C Hamanoba4b9282008-07-06 05:20:31590<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23591<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59592<div class="paragraph"><p>Compares the files in the working tree and the index. When paths
Junio C Hamano1a4e8412005-12-27 08:17:23593are specified, compares only those named paths. Otherwise all
594entries in the index are compared. The output format is the
Junio C Hamano1aa40d22010-01-21 17:46:43595same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23596</div>
Junio C Hamanoba4b9282008-07-06 05:20:31597<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23598<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59599<div class="dlist"><dl>
600<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23601-p
602</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59603<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:22604-u
605</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59606<dt class="hdlist1">
Junio C Hamanoe97d5772010-05-19 08:13:58607--patch
608</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23609<dd>
610<p>
Junio C Hamanoff979792007-11-16 10:11:30611 Generate patch (see section on generating patches).
612
Junio C Hamano1a4e8412005-12-27 08:17:23613</p>
614</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59615<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34616-U&lt;n&gt;
617</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59618<dt class="hdlist1">
Junio C Hamano69361562007-07-26 02:14:34619--unified=&lt;n&gt;
620</dt>
621<dd>
622<p>
623 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37624 the usual three.
625 Implies <tt>-p</tt>.
Junio C Hamano69361562007-07-26 02:14:34626</p>
627</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59628<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34629--raw
630</dt>
631<dd>
632<p>
633 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30634 This is the default.
Junio C Hamano9ae1a062006-07-10 08:12:34635</p>
636</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59637<dt class="hdlist1">
Junio C Hamano54559c82006-04-13 07:45:12638--patch-with-raw
639</dt>
640<dd>
641<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37642 Synonym for <tt>-p --raw</tt>.
Junio C Hamano54559c82006-04-13 07:45:12643</p>
644</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59645<dt class="hdlist1">
Junio C Hamano5a73f302011-10-14 05:58:34646--minimal
647</dt>
648<dd>
649<p>
650 Spend extra time to make sure the smallest possible
651 diff is produced.
652</p>
653</dd>
654<dt class="hdlist1">
Junio C Hamano20d47e32009-01-26 06:36:02655--patience
656</dt>
657<dd>
658<p>
659 Generate a diff using the "patience diff" algorithm.
660</p>
661</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59662<dt class="hdlist1">
Junio C Hamanoaea9e6b2012-03-07 00:17:11663--histogram
664</dt>
665<dd>
666<p>
667 Generate a diff using the "histogram diff" algorithm.
668</p>
669</dd>
670<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32671--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
Junio C Hamanoba7c8d82006-04-15 06:17:42672</dt>
673<dd>
674<p>
Junio C Hamanoaea9e6b2012-03-07 00:17:11675 Generate a diffstat. By default, as much space as necessary
676 will be used for the filename part, and the rest for the graph
677 part. Maximum width defaults to terminal width, or 80 columns
678 if not connected to a terminal, and can be overriden by
679 <tt>&lt;width&gt;</tt>. The width of the filename part can be limited by
680 giving another width <tt>&lt;name-width&gt;</tt> after a comma. The width
681 of the graph part can be limited by using
682 <tt>--stat-graph-width=&lt;width&gt;</tt> (affects all commands generating
683 a stat graph) or by setting <tt>diff.statGraphWidth=&lt;width&gt;</tt>
684 (does not affect <tt>git format-patch</tt>).
Junio C Hamano4c4b0122011-06-30 01:19:32685 By giving a third parameter <tt>&lt;count&gt;</tt>, you can limit the
Junio C Hamanoaea9e6b2012-03-07 00:17:11686 output to the first <tt>&lt;count&gt;</tt> lines, followed by <tt>&#8230;</tt> if
687 there are more.
Junio C Hamanoba7c8d82006-04-15 06:17:42688</p>
Junio C Hamano4c4b0122011-06-30 01:19:32689<div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=&lt;width&gt;</tt>,
690<tt>--stat-name-width=&lt;name-width&gt;</tt> and <tt>--stat-count=&lt;count&gt;</tt>.</p></div>
Junio C Hamanoba7c8d82006-04-15 06:17:42691</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59692<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:48693--numstat
694</dt>
695<dd>
696<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37697 Similar to <tt>--stat</tt>, but shows number of added and
Junio C Hamanofbe00522006-10-19 05:58:48698 deleted lines in decimal notation and pathname without
Junio C Hamanod793de52006-12-26 09:11:43699 abbreviation, to make it more machine friendly. For
700 binary files, outputs two <tt>-</tt> instead of saying
701 <tt>0 0</tt>.
Junio C Hamanofbe00522006-10-19 05:58:48702</p>
703</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59704<dt class="hdlist1">
Junio C Hamano7d23f5e2006-12-16 07:44:04705--shortstat
706</dt>
707<dd>
708<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37709 Output only the last line of the <tt>--stat</tt> format containing total
Junio C Hamano7d23f5e2006-12-16 07:44:04710 number of modified files, as well as number of added and deleted
711 lines.
712</p>
713</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59714<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32715--dirstat[=&lt;param1,param2,&#8230;&gt;]
Junio C Hamano6a45be92008-04-22 08:19:03716</dt>
717<dd>
718<p>
Junio C Hamano1c222c52011-05-13 19:55:32719 Output the distribution of relative amount of changes for each
720 sub-directory. The behavior of <tt>--dirstat</tt> can be customized by
721 passing it a comma separated list of parameters.
722 The defaults are controlled by the <tt>diff.dirstat</tt> configuration
723 variable (see <a href="git-config.html">git-config(1)</a>).
724 The following parameters are available:
Junio C Hamano6a45be92008-04-22 08:19:03725</p>
Junio C Hamano1c222c52011-05-13 19:55:32726<div class="dlist"><dl>
727<dt class="hdlist1">
728<tt>changes</tt>
729</dt>
730<dd>
731<p>
732 Compute the dirstat numbers by counting the lines that have been
733 removed from the source, or added to the destination. This ignores
734 the amount of pure code movements within a file. In other words,
735 rearranging lines in a file is not counted as much as other changes.
736 This is the default behavior when no parameter is given.
737</p>
Junio C Hamano6a45be92008-04-22 08:19:03738</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59739<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32740<tt>lines</tt>
Junio C Hamanoa476efa2008-10-10 15:31:42741</dt>
742<dd>
743<p>
Junio C Hamano1c222c52011-05-13 19:55:32744 Compute the dirstat numbers by doing the regular line-based diff
745 analysis, and summing the removed/added line counts. (For binary
746 files, count 64-byte chunks instead, since binary files have no
747 natural concept of lines). This is a more expensive <tt>--dirstat</tt>
748 behavior than the <tt>changes</tt> behavior, but it does count rearranged
749 lines within a file as much as other changes. The resulting output
750 is consistent with what you get from the other <tt>--*stat</tt> options.
Junio C Hamanoa476efa2008-10-10 15:31:42751</p>
752</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59753<dt class="hdlist1">
Junio C Hamano1c222c52011-05-13 19:55:32754<tt>files</tt>
755</dt>
756<dd>
757<p>
758 Compute the dirstat numbers by counting the number of files changed.
759 Each changed file counts equally in the dirstat analysis. This is
760 the computationally cheapest <tt>--dirstat</tt> behavior, since it does
761 not have to look at the file contents at all.
762</p>
763</dd>
764<dt class="hdlist1">
765<tt>cumulative</tt>
766</dt>
767<dd>
768<p>
769 Count changes in a child directory for the parent directory as well.
770 Note that when using <tt>cumulative</tt>, the sum of the percentages
771 reported may exceed 100%. The default (non-cumulative) behavior can
772 be specified with the <tt>noncumulative</tt> parameter.
773</p>
774</dd>
775<dt class="hdlist1">
776&lt;limit&gt;
777</dt>
778<dd>
779<p>
780 An integer parameter specifies a cut-off percent (3% by default).
781 Directories contributing less than this percentage of the changes
782 are not shown in the output.
783</p>
784</dd>
785</dl></div>
786<div class="paragraph"><p>Example: The following will count changed files, while ignoring
787directories with less than 10% of the total amount of changed files,
788and accumulating child directory counts in the parent directories:
789<tt>--dirstat=files,10,cumulative</tt>.</p></div>
790</dd>
791<dt class="hdlist1">
Junio C Hamano6959c6c2006-05-17 10:34:11792--summary
793</dt>
794<dd>
795<p>
796 Output a condensed summary of extended header information
797 such as creations, renames and mode changes.
798</p>
799</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59800<dt class="hdlist1">
Junio C Hamanod1308c92006-04-16 11:01:09801--patch-with-stat
802</dt>
803<dd>
804<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37805 Synonym for <tt>-p --stat</tt>.
Junio C Hamanod1308c92006-04-16 11:01:09806</p>
807</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59808<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23809-z
810</dt>
811<dd>
812<p>
Junio C Hamano0c053e82010-04-19 06:46:34813 When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been
814 given, do not munge pathnames and use NULs as output field terminators.
Junio C Hamano1a4e8412005-12-27 08:17:23815</p>
Junio C Hamano68cf15a2010-11-06 01:01:59816<div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes,
Junio C Hamano5706e0b2009-11-24 10:54:16817and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>,
818respectively, and the pathname will be enclosed in double quotes if
819any of those replacements occurred.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23820</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59821<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23822--name-only
823</dt>
824<dd>
825<p>
826 Show only names of changed files.
827</p>
828</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59829<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23830--name-status
831</dt>
832<dd>
833<p>
Junio C Hamanoa9aee782008-04-23 16:09:20834 Show only names and status of changed files. See the description
835 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano1a4e8412005-12-27 08:17:23836</p>
837</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59838<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55839--submodule[=&lt;format&gt;]
840</dt>
841<dd>
842<p>
Junio C Hamanoe768cc12012-03-16 05:43:05843 Specify how differences in submodules are shown. When <tt>--submodule</tt>
844 or <tt>--submodule=log</tt> is given, the <em>log</em> format is used. This format lists
845 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <tt>summary</tt> does.
846 Omitting the <tt>--submodule</tt> option or specifying <tt>--submodule=short</tt>,
847 uses the <em>short</em> format. This format just shows the names of the commits
848 at the beginning and end of the range.
Junio C Hamanoc21ab052009-10-31 04:03:55849</p>
850</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59851<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:12852--color[=&lt;when&gt;]
Junio C Hamano9ae1a062006-07-10 08:12:34853</dt>
854<dd>
855<p>
856 Show colored diff.
Junio C Hamano5f2627d2011-05-06 20:23:48857 The value must be <tt>always</tt> (the default for <tt>&lt;when&gt;</tt>), <tt>never</tt>, or <tt>auto</tt>.
858 The default value is <tt>never</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34859</p>
860</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59861<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34862--no-color
863</dt>
864<dd>
865<p>
Junio C Hamano5f2627d2011-05-06 20:23:48866 Turn off colored diff.
867 It is the same as <tt>--color=never</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34868</p>
869</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59870<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53871--word-diff[=&lt;mode&gt;]
Junio C Hamano85e45fa2006-08-13 07:47:41872</dt>
873<dd>
874<p>
Junio C Hamanocc7636a2010-05-21 14:57:53875 Show a word diff, using the &lt;mode&gt; to delimit changed words.
876 By default, words are delimited by whitespace; see
877 <tt>--word-diff-regex</tt> below. The &lt;mode&gt; defaults to <em>plain</em>, and
878 must be one of:
Junio C Hamano85e45fa2006-08-13 07:47:41879</p>
Junio C Hamano68cf15a2010-11-06 01:01:59880<div class="dlist"><dl>
881<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53882color
883</dt>
884<dd>
885<p>
886 Highlight changed words using only colors. Implies <tt>--color</tt>.
887</p>
888</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59889<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53890plain
891</dt>
892<dd>
893<p>
Junio C Hamano68cf15a2010-11-06 01:01:59894 Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no
Junio C Hamanocc7636a2010-05-21 14:57:53895 attempts to escape the delimiters if they appear in the input,
896 so the output may be ambiguous.
897</p>
898</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59899<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53900porcelain
901</dt>
902<dd>
903<p>
904 Use a special line-based format intended for script
905 consumption. Added/removed/unchanged runs are printed in the
Junio C Hamano68cf15a2010-11-06 01:01:59906 usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` `
Junio C Hamanocc7636a2010-05-21 14:57:53907 character at the beginning of the line and extending to the
908 end of the line. Newlines in the input are represented by a
909 tilde <tt>~</tt> on a line of its own.
910</p>
911</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59912<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53913none
914</dt>
915<dd>
916<p>
917 Disable word diff again.
918</p>
919</dd>
920</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:59921<div class="paragraph"><p>Note that despite the name of the first mode, color is used to
Junio C Hamanocc7636a2010-05-21 14:57:53922highlight the changed parts in all modes if enabled.</p></div>
923</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59924<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53925--word-diff-regex=&lt;regex&gt;
926</dt>
927<dd>
928<p>
929 Use &lt;regex&gt; to decide what a word is, instead of considering
930 runs of non-whitespace to be a word. Also implies
931 <tt>--word-diff</tt> unless it was already enabled.
932</p>
Junio C Hamano68cf15a2010-11-06 01:01:59933<div class="paragraph"><p>Every non-overlapping match of the
Junio C Hamano20d47e32009-01-26 06:36:02934&lt;regex&gt; is considered a word. Anything between these matches is
935considered whitespace and ignored(!) for the purposes of finding
936differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
937expression to make sure that it matches all non-whitespace characters.
938A match that contains a newline is silently truncated(!) at the
939newline.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59940<div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see
Junio C Hamano20d47e32009-01-26 06:36:02941<a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
942overrides any diff driver or configuration setting. Diff drivers
943override configuration settings.</p></div>
Junio C Hamano85e45fa2006-08-13 07:47:41944</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59945<dt class="hdlist1">
Junio C Hamanocc7636a2010-05-21 14:57:53946--color-words[=&lt;regex&gt;]
947</dt>
948<dd>
949<p>
950 Equivalent to <tt>--word-diff=color</tt> plus (if a regex was
951 specified) <tt>--word-diff-regex=&lt;regex&gt;</tt>.
952</p>
953</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59954<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34955--no-renames
956</dt>
957<dd>
958<p>
959 Turn off rename detection, even when the configuration
960 file gives the default to do so.
961</p>
962</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59963<dt class="hdlist1">
Junio C Hamanoa890c4f2007-01-28 10:29:21964--check
965</dt>
966<dd>
967<p>
Junio C Hamano6005bfa2011-06-23 00:51:22968 Warn if changes introduce whitespace errors. What are
969 considered whitespace errors is controlled by <tt>core.whitespace</tt>
970 configuration. By default, trailing whitespaces (including
971 lines that solely consist of whitespaces) and a space character
972 that is immediately followed by a tab character inside the
973 initial indent of the line are considered whitespace errors.
974 Exits with non-zero status if problems are found. Not compatible
975 with --exit-code.
Junio C Hamanoa890c4f2007-01-28 10:29:21976</p>
977</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59978<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23979--full-index
980</dt>
981<dd>
982<p>
Junio C Hamano5cf43ca2008-08-20 09:14:14983 Instead of the first handful of characters, show the full
984 pre- and post-image blob object names on the "index"
985 line when generating patch format output.
Junio C Hamano1a4e8412005-12-27 08:17:23986</p>
987</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59988<dt class="hdlist1">
Junio C Hamano9ae1a062006-07-10 08:12:34989--binary
990</dt>
991<dd>
992<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37993 In addition to <tt>--full-index</tt>, output a binary diff that
994 can be applied with <tt>git-apply</tt>.
Junio C Hamano9ae1a062006-07-10 08:12:34995</p>
996</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59997<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23998--abbrev[=&lt;n&gt;]
999</dt>
1000<dd>
1001<p>
1002 Instead of showing the full 40-byte hexadecimal object
1003 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:561004 lines, show only a partial prefix. This is
Junio C Hamano3b70d3c2009-11-21 17:37:371005 independent of the <tt>--full-index</tt> option above, which controls
Junio C Hamano1a4e8412005-12-27 08:17:231006 the diff-patch output format. Non default number of
Junio C Hamano3b70d3c2009-11-21 17:37:371007 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:231008</p>
1009</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591010<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141011-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231012</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591013<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541014--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
1015</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231016<dd>
1017<p>
Junio C Hamanoe85e36f2010-08-10 05:30:141018 Break complete rewrite changes into pairs of delete and
1019 create. This serves two purposes:
Junio C Hamano1a4e8412005-12-27 08:17:231020</p>
Junio C Hamano68cf15a2010-11-06 01:01:591021<div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
Junio C Hamanoe85e36f2010-08-10 05:30:141022not as a series of deletion and insertion mixed together with a very
1023few lines that happen to match textually as the context, but as a
1024single deletion of everything old followed by a single insertion of
1025everything new, and the number <tt>m</tt> controls this aspect of the -B
1026option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
1027original should remain in the result for git to consider it a total
1028rewrite (i.e. otherwise the resulting patch will be a series of
1029deletion and insertion mixed together with context lines).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591030<div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
Junio C Hamanoe85e36f2010-08-10 05:30:141031source of a rename (usually -M only considers a file that disappeared
1032as the source of a rename), and the number <tt>n</tt> controls this aspect of
1033the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
Junio C Hamano68cf15a2010-11-06 01:01:591034addition and deletion compared to 20% or more of the file&#8217;s size are
Junio C Hamanoe85e36f2010-08-10 05:30:141035eligible for being picked up as a possible source of a rename to
1036another file.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231037</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591038<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141039-M[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231040</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591041<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261042--find-renames[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541043</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231044<dd>
1045<p>
1046 Detect renames.
Junio C Hamano5f2627d2011-05-06 20:23:481047 If <tt>n</tt> is specified, it is a threshold on the similarity
Junio C Hamanoe85e36f2010-08-10 05:30:141048 index (i.e. amount of addition/deletions compared to the
Junio C Hamano68cf15a2010-11-06 01:01:591049 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
Junio C Hamanoe85e36f2010-08-10 05:30:141050 delete/add pair to be a rename if more than 90% of the file
Junio C Hamano68cf15a2010-11-06 01:01:591051 hasn&#8217;t changed.
Junio C Hamano1a4e8412005-12-27 08:17:231052</p>
1053</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591054<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:141055-C[&lt;n&gt;]
Junio C Hamano1a4e8412005-12-27 08:17:231056</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591057<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261058--find-copies[=&lt;n&gt;]
Junio C Hamano39c7a692010-10-27 06:08:541059</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231060<dd>
1061<p>
Junio C Hamano16f98872007-06-12 16:09:141062 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamanoe85e36f2010-08-10 05:30:141063 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:231064</p>
1065</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591066<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231067--find-copies-harder
1068</dt>
1069<dd>
1070<p>
Junio C Hamano16f98872007-06-12 16:09:141071 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano1a4e8412005-12-27 08:17:231072 if the original file of the copy was modified in the same
1073 changeset. This flag makes the command
1074 inspect unmodified files as candidates for the source of
1075 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:141076 projects, so use it with caution. Giving more than one
1077 <tt>-C</tt> option has the same effect.
Junio C Hamano1a4e8412005-12-27 08:17:231078</p>
1079</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591080<dt class="hdlist1">
Junio C Hamanob02377c2011-04-28 22:26:021081-D
1082</dt>
1083<dt class="hdlist1">
1084--irreversible-delete
1085</dt>
1086<dd>
1087<p>
1088 Omit the preimage for deletes, i.e. print only the header but not
1089 the diff between the preimage and <tt>/dev/null</tt>. The resulting patch
1090 is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is
1091 solely for people who want to just concentrate on reviewing the
1092 text after the change. In addition, the output obviously lack
1093 enough information to apply such a patch in reverse, even manually,
1094 hence the name of the option.
1095</p>
1096<div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part
1097of a delete/create pair.</p></div>
1098</dd>
1099<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231100-l&lt;num&gt;
1101</dt>
1102<dd>
1103<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371104 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
Junio C Hamano1a4e8412005-12-27 08:17:231105 is the number of potential rename/copy targets. This
1106 option prevents rename/copy detection from running if
1107 the number of rename/copy targets exceeds the specified
1108 number.
1109</p>
1110</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591111<dt class="hdlist1">
Junio C Hamano982eb112010-11-18 00:53:091112--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
1113</dt>
1114<dd>
1115<p>
1116 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
1117 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
1118 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
1119 are Unmerged (<tt>U</tt>), are
1120 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
1121 Any combination of the filter characters (including none) can be used.
1122 When <tt>*</tt> (All-or-none) is added to the combination, all
1123 paths are selected if there is any file that matches
1124 other criteria in the comparison; if there is no file
1125 that matches other criteria, nothing is selected.
1126</p>
1127</dd>
1128<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231129-S&lt;string&gt;
1130</dt>
1131<dd>
1132<p>
Junio C Hamano5217a272009-03-21 00:39:331133 Look for differences that introduce or remove an instance of
1134 &lt;string&gt;. Note that this is different than the string simply
1135 appearing in diff output; see the <em>pickaxe</em> entry in
1136 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
Junio C Hamano1a4e8412005-12-27 08:17:231137</p>
1138</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591139<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:341140-G&lt;regex&gt;
1141</dt>
1142<dd>
1143<p>
1144 Look for differences whose added or removed line matches
1145 the given &lt;regex&gt;.
1146</p>
1147</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591148<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231149--pickaxe-all
1150</dt>
1151<dd>
1152<p>
Junio C Hamano3b4609d2010-09-30 00:04:341153 When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that
Junio C Hamano1a4e8412005-12-27 08:17:231154 changeset, not just the files that contain the change
1155 in &lt;string&gt;.
1156</p>
1157</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591158<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281159--pickaxe-regex
1160</dt>
1161<dd>
1162<p>
1163 Make the &lt;string&gt; not a plain string but an extended POSIX
1164 regex to match.
1165</p>
1166</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591167<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231168-O&lt;orderfile&gt;
1169</dt>
1170<dd>
1171<p>
1172 Output the patch in the order specified in the
1173 &lt;orderfile&gt;, which has one shell glob pattern per line.
1174</p>
1175</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591176<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231177-R
1178</dt>
1179<dd>
1180<p>
1181 Swap two inputs; that is, show differences from index or
1182 on-disk file to tree contents.
1183</p>
1184</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591185<dt class="hdlist1">
Junio C Hamano24bc09a2008-02-28 00:27:441186--relative[=&lt;path&gt;]
1187</dt>
1188<dd>
1189<p>
1190 When run from a subdirectory of the project, it can be
1191 told to exclude changes outside the directory and show
1192 pathnames relative to it with this option. When you are
1193 not in a subdirectory (e.g. in a bare repository), you
1194 can name which subdirectory to make the output relative
1195 to by giving a &lt;path&gt; as an argument.
1196</p>
1197</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591198<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221199-a
1200</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591201<dt class="hdlist1">
Junio C Hamanoc26f5482006-07-09 09:38:141202--text
1203</dt>
1204<dd>
1205<p>
1206 Treat all files as text.
1207</p>
1208</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591209<dt class="hdlist1">
Junio C Hamanofd468962007-02-14 23:45:041210--ignore-space-at-eol
1211</dt>
1212<dd>
1213<p>
Junio C Hamano3a702342007-12-12 21:34:021214 Ignore changes in whitespace at EOL.
Junio C Hamanofd468962007-02-14 23:45:041215</p>
1216</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591217<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221218-b
1219</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591220<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071221--ignore-space-change
1222</dt>
1223<dd>
1224<p>
Junio C Hamano3a702342007-12-12 21:34:021225 Ignore changes in amount of whitespace. This ignores whitespace
1226 at line end, and considers all other sequences of one or
1227 more whitespace characters to be equivalent.
Junio C Hamanod9c2d2f2006-12-06 08:59:071228</p>
1229</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591230<dt class="hdlist1">
Junio C Hamanobbbb8652008-12-29 10:34:221231-w
Junio C Hamanod9c2d2f2006-12-06 08:59:071232</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591233<dt class="hdlist1">
Junio C Hamanod9c2d2f2006-12-06 08:59:071234--ignore-all-space
1235</dt>
1236<dd>
1237<p>
Junio C Hamano3a702342007-12-12 21:34:021238 Ignore whitespace when comparing lines. This ignores
1239 differences even if one line has whitespace where the other
Junio C Hamanod9c2d2f2006-12-06 08:59:071240 line has none.
1241</p>
1242</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591243<dt class="hdlist1">
Junio C Hamano1d40ee82009-01-07 10:14:161244--inter-hunk-context=&lt;lines&gt;
1245</dt>
1246<dd>
1247<p>
1248 Show the context between diff hunks, up to the specified number
1249 of lines, thereby fusing hunks that are close to each other.
1250</p>
1251</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591252<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:091253-W
1254</dt>
1255<dt class="hdlist1">
1256--function-context
1257</dt>
1258<dd>
1259<p>
1260 Show whole surrounding functions of changes.
1261</p>
1262</dd>
1263<dt class="hdlist1">
Junio C Hamano48fd2f62007-03-19 02:02:301264--exit-code
1265</dt>
1266<dd>
1267<p>
1268 Make the program exit with codes similar to diff(1).
1269 That is, it exits with 1 if there were differences and
1270 0 means no differences.
1271</p>
1272</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591273<dt class="hdlist1">
Junio C Hamano35e57552007-03-25 07:54:351274--quiet
1275</dt>
1276<dd>
1277<p>
Junio C Hamano3b70d3c2009-11-21 17:37:371278 Disable all output of the program. Implies <tt>--exit-code</tt>.
Junio C Hamano35e57552007-03-25 07:54:351279</p>
1280</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591281<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401282--ext-diff
1283</dt>
1284<dd>
1285<p>
1286 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:531287 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1288 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:401289</p>
1290</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591291<dt class="hdlist1">
Junio C Hamanobb0f4042007-07-04 06:41:401292--no-ext-diff
1293</dt>
1294<dd>
1295<p>
1296 Disallow external diff drivers.
1297</p>
1298</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591299<dt class="hdlist1">
Junio C Hamanoc652aed2011-07-07 01:14:311300--textconv
1301</dt>
1302<dt class="hdlist1">
1303--no-textconv
1304</dt>
1305<dd>
1306<p>
1307 Allow (or disallow) external text conversion filters to be run
1308 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
1309 details. Because textconv filters are typically a one-way
1310 conversion, the resulting diff is suitable for human
1311 consumption, but cannot be applied. For this reason, textconv
1312 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1313 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
1314 diff plumbing commands.
1315</p>
1316</dd>
1317<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:511318--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:141319</dt>
1320<dd>
1321<p>
Junio C Hamano7d449522010-07-01 00:08:511322 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
Junio C Hamano619596a2010-08-18 22:15:351323 either "none", "untracked", "dirty" or "all", which is the default
1324 Using "none" will consider the submodule modified when it either contains
1325 untracked or modified files or its HEAD differs from the commit recorded
1326 in the superproject and can be used to override any settings of the
1327 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
Junio C Hamano7d449522010-07-01 00:08:511328 "untracked" is used submodules are not considered dirty when they only
1329 contain untracked content (but they are still scanned for modified
1330 content). Using "dirty" ignores all changes to the work tree of submodules,
1331 only changes to the commits stored in the superproject are shown (this was
1332 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:141333</p>
1334</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591335<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331336--src-prefix=&lt;prefix&gt;
1337</dt>
1338<dd>
1339<p>
1340 Show the given source prefix instead of "a/".
1341</p>
1342</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591343<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331344--dst-prefix=&lt;prefix&gt;
1345</dt>
1346<dd>
1347<p>
1348 Show the given destination prefix instead of "b/".
1349</p>
1350</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591351<dt class="hdlist1">
Junio C Hamanoe27cbd22007-12-21 17:57:331352--no-prefix
1353</dt>
1354<dd>
1355<p>
1356 Do not show any source or destination prefix.
1357</p>
1358</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311359</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591360<div class="paragraph"><p>For more detailed explanation on these common options, see also
Junio C Hamanoba4b9282008-07-06 05:20:311361<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591362<div class="dlist"><dl>
1363<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371364-1 --base
1365</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591366<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371367-2 --ours
1368</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591369<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371370-3 --theirs
1371</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591372<dt class="hdlist1">
Junio C Hamanobd53dbf2009-01-18 18:26:371373-0
Junio C Hamano1a4e8412005-12-27 08:17:231374</dt>
1375<dd>
1376<p>
1377 Diff against the "base" version, "our branch" or "their
1378 branch" respectively. With these options, diffs for
1379 merged entries are not shown.
1380</p>
Junio C Hamano68cf15a2010-11-06 01:01:591381<div class="paragraph"><p>The default is to diff against our branch (-2) and the
Junio C Hamano1a4e8412005-12-27 08:17:231382cleanly resolved paths. The option -0 can be given to
Junio C Hamanoba4b9282008-07-06 05:20:311383omit diff output for unmerged entries and just show "Unmerged".</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231384</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591385<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471386-c
1387</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591388<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471389--cc
Junio C Hamanofb56a962006-01-28 10:38:191390</dt>
1391<dd>
1392<p>
1393 This compares stage 2 (our branch), stage 3 (their
1394 branch) and the working tree file and outputs a combined
1395 diff, similar to the way <em>diff-tree</em> shows a merge
1396 commit with these flags.
1397</p>
1398</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591399<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231400-q
1401</dt>
1402<dd>
1403<p>
Junio C Hamano51c2ab02006-07-09 20:38:541404 Remain silent even on nonexistent files
Junio C Hamano1a4e8412005-12-27 08:17:231405</p>
1406</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311407</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231408</div>
Junio C Hamano543f8d62009-07-29 08:35:211409<h2 id="_raw_output_format">Raw output format</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231410<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591411<div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree",
Junio C Hamanoba4b9282008-07-06 05:20:311412"git-diff-files" and "git diff --raw" are very similar.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591413<div class="paragraph"><p>These commands all compare two sets of things; what is
Junio C Hamanoba4b9282008-07-06 05:20:311414compared differs:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591415<div class="dlist"><dl>
1416<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231417git-diff-index &lt;tree-ish&gt;
1418</dt>
1419<dd>
1420<p>
1421 compares the &lt;tree-ish&gt; and the files on the filesystem.
1422</p>
1423</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591424<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231425git-diff-index --cached &lt;tree-ish&gt;
1426</dt>
1427<dd>
1428<p>
1429 compares the &lt;tree-ish&gt; and the index.
1430</p>
1431</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591432<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231433git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]
1434</dt>
1435<dd>
1436<p>
1437 compares the trees named by the two arguments.
1438</p>
1439</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591440<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231441git-diff-files [&lt;pattern&gt;&#8230;]
1442</dt>
1443<dd>
1444<p>
1445 compares the index and the files on the filesystem.
1446</p>
1447</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311448</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591449<div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of
Junio C Hamano543f8d62009-07-29 08:35:211450what is being compared. After that, all the commands print one output
1451line per changed file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591452<div class="paragraph"><p>An output line is formatted this way:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231453<div class="listingblock">
1454<div class="content">
1455<pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0
1456copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2
1457rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3
1458create :000000 100644 0000000... 1234567... A file4
1459delete :100644 000000 1234567... 0000000... D file5
1460unmerged :000000 000000 0000000... 0000000... U file6</tt></pre>
1461</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591462<div class="paragraph"><p>That is, from the left to the right:</p></div>
1463<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231464<li>
1465<p>
1466a colon.
1467</p>
1468</li>
1469<li>
1470<p>
1471mode for "src"; 000000 if creation or unmerged.
1472</p>
1473</li>
1474<li>
1475<p>
1476a space.
1477</p>
1478</li>
1479<li>
1480<p>
1481mode for "dst"; 000000 if deletion or unmerged.
1482</p>
1483</li>
1484<li>
1485<p>
1486a space.
1487</p>
1488</li>
1489<li>
1490<p>
1491sha1 for "src"; 0{40} if creation or unmerged.
1492</p>
1493</li>
1494<li>
1495<p>
1496a space.
1497</p>
1498</li>
1499<li>
1500<p>
1501sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".
1502</p>
1503</li>
1504<li>
1505<p>
1506a space.
1507</p>
1508</li>
1509<li>
1510<p>
1511status, followed by optional "score" number.
1512</p>
1513</li>
1514<li>
1515<p>
1516a tab or a NUL when <em>-z</em> option is used.
1517</p>
1518</li>
1519<li>
1520<p>
1521path for "src"
1522</p>
1523</li>
1524<li>
1525<p>
1526a tab or a NUL when <em>-z</em> option is used; only exists for C or R.
1527</p>
1528</li>
1529<li>
1530<p>
1531path for "dst"; only exists for C or R.
1532</p>
1533</li>
1534<li>
1535<p>
1536an LF or a NUL when <em>-z</em> option is used, to terminate the record.
1537</p>
1538</li>
Junio C Hamanoba4b9282008-07-06 05:20:311539</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591540<div class="paragraph"><p>Possible status letters are:</p></div>
1541<div class="ulist"><ul>
Junio C Hamanoaa17c7c2008-11-03 04:36:581542<li>
1543<p>
1544A: addition of a file
1545</p>
1546</li>
1547<li>
1548<p>
1549C: copy of a file into a new one
1550</p>
1551</li>
1552<li>
1553<p>
1554D: deletion of a file
1555</p>
1556</li>
1557<li>
1558<p>
1559M: modification of the contents or mode of a file
1560</p>
1561</li>
1562<li>
1563<p>
1564R: renaming of a file
1565</p>
1566</li>
1567<li>
1568<p>
1569T: change in the type of the file
1570</p>
1571</li>
1572<li>
1573<p>
1574U: file is unmerged (you must complete the merge before it can
1575be committed)
1576</p>
1577</li>
1578<li>
1579<p>
1580X: "unknown" change type (most probably a bug, please report it)
1581</p>
1582</li>
1583</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591584<div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the
Junio C Hamanoaa17c7c2008-11-03 04:36:581585percentage of similarity between the source and target of the move or
1586copy), and are the only ones to be so.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591587<div class="paragraph"><p>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem
Junio C Hamanoba4b9282008-07-06 05:20:311588and it is out of sync with the index.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591589<div class="paragraph"><p>Example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231590<div class="listingblock">
1591<div class="content">
1592<pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre>
1593</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591594<div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
Junio C Hamano1a4e8412005-12-27 08:17:231595in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
Junio C Hamanoba4b9282008-07-06 05:20:311596respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231597</div>
Junio C Hamanoba4b9282008-07-06 05:20:311598<h2 id="_diff_format_for_merges">diff format for merges</h2>
Junio C Hamano67fad6d2007-05-06 08:53:121599<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591600<div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
Junio C Hamano7ae0ab22007-11-03 02:46:461601can take <em>-c</em> or <em>--cc</em> option
Junio C Hamano67fad6d2007-05-06 08:53:121602to generate diff output also for merge commits. The output differs
Junio C Hamanoba4b9282008-07-06 05:20:311603from the format described above in the following way:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591604<div class="olist arabic"><ol class="arabic">
Junio C Hamano67fad6d2007-05-06 08:53:121605<li>
1606<p>
1607there is a colon for each parent
1608</p>
1609</li>
1610<li>
1611<p>
1612there are more "src" modes and "src" sha1
1613</p>
1614</li>
1615<li>
1616<p>
1617status is concatenated status characters for each parent
1618</p>
1619</li>
1620<li>
1621<p>
1622no optional "score" number
1623</p>
1624</li>
1625<li>
1626<p>
1627single path, only for "dst"
1628</p>
1629</li>
Junio C Hamanoba4b9282008-07-06 05:20:311630</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591631<div class="paragraph"><p>Example:</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121632<div class="listingblock">
1633<div class="content">
1634<pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre>
1635</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591636<div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from
Junio C Hamanoba4b9282008-07-06 05:20:311637all parents.</p></div>
Junio C Hamano67fad6d2007-05-06 08:53:121638</div>
Junio C Hamanoba4b9282008-07-06 05:20:311639<h2 id="_generating_patches_with_p">Generating patches with -p</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231640<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591641<div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
Junio C Hamano00b8b632007-12-07 09:50:491642with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or
1643"git log" with the "-p" option, they
Junio C Hamano7ae0ab22007-11-03 02:46:461644do not produce the output described above; instead they produce a
1645patch file. You can customize the creation of such patches via the
Junio C Hamanoba4b9282008-07-06 05:20:311646GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591647<div class="paragraph"><p>What the -p option produces is slightly different from the traditional
Junio C Hamano7f9fa862010-10-19 23:51:141648diff format:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591649<div class="olist arabic"><ol class="arabic">
Junio C Hamano1a4e8412005-12-27 08:17:231650<li>
1651<p>
Junio C Hamano7f9fa862010-10-19 23:51:141652It is preceded with a "git diff" header that looks like this:
Junio C Hamano1a4e8412005-12-27 08:17:231653</p>
1654<div class="literalblock">
1655<div class="content">
1656<pre><tt>diff --git a/file1 b/file2</tt></pre>
1657</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591658<div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is
Junio C Hamano1a4e8412005-12-27 08:17:231659involved. Especially, even for a creation or a deletion,
Junio C Hamano68cf15a2010-11-06 01:01:591660<tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>
1661<div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the
Junio C Hamano1a4e8412005-12-27 08:17:231662name of the source file of the rename/copy and the name of
Junio C Hamanoba4b9282008-07-06 05:20:311663the file that rename/copy produces, respectively.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231664</li>
1665<li>
1666<p>
1667It is followed by one or more extended header lines:
1668</p>
1669<div class="literalblock">
1670<div class="content">
1671<pre><tt>old mode &lt;mode&gt;
1672new mode &lt;mode&gt;
1673deleted file mode &lt;mode&gt;
1674new file mode &lt;mode&gt;
1675copy from &lt;path&gt;
1676copy to &lt;path&gt;
1677rename from &lt;path&gt;
1678rename to &lt;path&gt;
1679similarity index &lt;number&gt;
1680dissimilarity index &lt;number&gt;
1681index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</tt></pre>
1682</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591683<div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type
Junio C Hamano7f9fa862010-10-19 23:51:141684and file permission bits.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591685<div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div>
1686<div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and
Junio C Hamano7f9fa862010-10-19 23:51:141687the dissimilarity index is the percentage of changed lines. It
1688is a rounded down integer, followed by a percent sign. The
1689similarity index value of 100% is thus reserved for two equal
1690files, while 100% dissimilarity means that no line from the old
1691file made it into the new one.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591692<div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change.
Junio C Hamano7f9fa862010-10-19 23:51:141693The &lt;mode&gt; is included if the file mode does not change; otherwise,
1694separate lines indicate the old and the new mode.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231695</li>
1696<li>
1697<p>
Junio C Hamanoa053d542006-10-27 09:29:131698TAB, LF, double quote and backslash characters in pathnames
1699 are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.
1700 If there is need for such substitution then the whole
1701 pathname is put in double quotes.
Junio C Hamano1a4e8412005-12-27 08:17:231702</p>
1703</li>
Junio C Hamano7f9fa862010-10-19 23:51:141704<li>
1705<p>
1706All the <tt>file1</tt> files in the output refer to files before the
1707 commit, and all the <tt>file2</tt> files refer to files after the commit.
1708 It is incorrect to apply each change to each file sequentially. For
1709 example, this patch will swap a and b:
1710</p>
1711<div class="literalblock">
1712<div class="content">
1713<pre><tt>diff --git a/a b/b
1714rename from a
1715rename to b
1716diff --git a/b b/a
1717rename from b
1718rename to a</tt></pre>
1719</div></div>
1720</li>
Junio C Hamanoba4b9282008-07-06 05:20:311721</ol></div>
Junio C Hamano1a4e8412005-12-27 08:17:231722</div>
Junio C Hamanoba4b9282008-07-06 05:20:311723<h2 id="_combined_diff_format">combined diff format</h2>
Junio C Hamanofb56a962006-01-28 10:38:191724<div class="sectionbody">
Junio C Hamanoc5be4cc2011-03-09 07:20:431725<div class="paragraph"><p>Any diff-generating command can take the &#8216;-c` or <tt>--cc</tt> option to
1726produce a <em>combined diff</em> when showing a merge. This is the default
1727format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
1728<a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m&#8217; option to any
1729of these commands to force generation of diffs with individual parents
1730of a merge.</p></div>
1731<div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div>
Junio C Hamanofb56a962006-01-28 10:38:191732<div class="listingblock">
1733<div class="content">
1734<pre><tt>diff --combined describe.c
Junio C Hamano29f14312006-10-26 08:47:291735index fabadb8,cc95eb0..4866510
1736--- a/describe.c
1737+++ b/describe.c
1738@@@ -98,20 -98,12 +98,20 @@@
1739 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
Junio C Hamanofb56a962006-01-28 10:38:191740 }
1741
1742- static void describe(char *arg)
1743 -static void describe(struct commit *cmit, int last_one)
1744++static void describe(char *arg, int last_one)
1745 {
Junio C Hamano29f14312006-10-26 08:47:291746 + unsigned char sha1[20];
1747 + struct commit *cmit;
1748 struct commit_list *list;
1749 static int initialized = 0;
1750 struct commit_name *n;
1751
1752 + if (get_sha1(arg, sha1) &lt; 0)
1753 + usage(describe_usage);
1754 + cmit = lookup_commit_reference(sha1);
1755 + if (!cmit)
1756 + usage(describe_usage);
1757 +
1758 if (!initialized) {
1759 initialized = 1;
1760 for_each_ref(get_name);</tt></pre>
Junio C Hamanofb56a962006-01-28 10:38:191761</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591762<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:291763<li>
1764<p>
1765It is preceded with a "git diff" header, that looks like
1766 this (when <em>-c</em> option is used):
1767</p>
1768<div class="literalblock">
1769<div class="content">
1770<pre><tt>diff --combined file</tt></pre>
1771</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591772<div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div>
Junio C Hamano29f14312006-10-26 08:47:291773<div class="literalblock">
1774<div class="content">
Junio C Hamano0868a302008-07-22 09:20:441775<pre><tt>diff --cc file</tt></pre>
Junio C Hamano29f14312006-10-26 08:47:291776</div></div>
1777</li>
1778<li>
1779<p>
1780It is followed by one or more extended header lines
1781 (this example shows a merge with two parents):
1782</p>
1783<div class="literalblock">
1784<div class="content">
1785<pre><tt>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
1786mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
1787new file mode &lt;mode&gt;
1788deleted file mode &lt;mode&gt;,&lt;mode&gt;</tt></pre>
1789</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591790<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
Junio C Hamanoee1e4282007-02-04 08:32:041791the &lt;mode&gt; is different from the rest. Extended headers with
Junio C Hamano29f14312006-10-26 08:47:291792information about detected contents movement (renames and
1793copying detection) are designed to work with diff of two
Junio C Hamanoba4b9282008-07-06 05:20:311794&lt;tree-ish&gt; and are not used by combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291795</li>
1796<li>
1797<p>
1798It is followed by two-line from-file/to-file header
1799</p>
1800<div class="literalblock">
1801<div class="content">
1802<pre><tt>--- a/file
1803+++ b/file</tt></pre>
1804</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591805<div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff
Junio C Hamano29f14312006-10-26 08:47:291806format, <tt>/dev/null</tt> is used to signal created or deleted
Junio C Hamanoba4b9282008-07-06 05:20:311807files.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291808</li>
1809<li>
1810<p>
1811Chunk header format is modified to prevent people from
1812 accidentally feeding it to <tt>patch -p1</tt>. Combined diff format
1813 was created for review of merge commit changes, and was not
1814 meant for apply. The change is similar to the change in the
1815 extended <em>index</em> header:
1816</p>
1817<div class="literalblock">
1818<div class="content">
1819<pre><tt>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</tt></pre>
1820</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591821<div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk
Junio C Hamanoba4b9282008-07-06 05:20:311822header for combined diff format.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291823</li>
Junio C Hamanoba4b9282008-07-06 05:20:311824</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591825<div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two
1826files 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
1827added to B), or <tt>" "</tt> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanofb56a962006-01-28 10:38:191828compares two or more files file1, file2,&#8230; with one file X, and
1829shows how X differs from each of fileN. One column for each of
Junio C Hamano68cf15a2010-11-06 01:01:591830fileN is prepended to the output line to note how X&#8217;s line is
Junio C Hamanoba4b9282008-07-06 05:20:311831different from it.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591832<div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in
Junio C Hamano29f14312006-10-26 08:47:291833fileN but it does not appear in the result. A <tt>+</tt> character
Junio C Hamano54bf1e22008-12-20 06:30:111834in the column N means that the line appears in the result,
Junio C Hamano29f14312006-10-26 08:47:291835and fileN does not have that line (in other words, the line was
Junio C Hamanoba4b9282008-07-06 05:20:311836added, from the point of view of that parent).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591837<div class="paragraph"><p>In the above example output, the function signature was changed
Junio C Hamanofb56a962006-01-28 10:38:191838from both files (hence two <tt>-</tt> removals from both file1 and
Junio C Hamano4604fe52008-09-19 06:37:101839file2, plus <tt>++</tt> to mean one line that was added does not appear
Junio C Hamano54bf1e22008-12-20 06:30:111840in either file1 nor file2). Also eight other lines are the same
1841from file1 but do not appear in file2 (hence prefixed with <tt>&#43;</tt>).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591842<div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a
Junio C Hamanofb56a962006-01-28 10:38:191843merge commit with the merge result (i.e. file1..fileN are the
1844parents). When shown by <tt>git diff-files -c</tt>, it compares the
1845two unresolved merge parents with the working tree file
1846(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
Junio C Hamanoba4b9282008-07-06 05:20:311847"their version").</p></div>
Junio C Hamanofb56a962006-01-28 10:38:191848</div>
Junio C Hamanoba4b9282008-07-06 05:20:311849<h2 id="_other_diff_formats">other diff formats</h2>
Junio C Hamano3a702342007-12-12 21:34:021850<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591851<div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and
Junio C Hamano3a702342007-12-12 21:34:021852copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the
1853output. These options can be combined with other options, such as
Junio C Hamanoba4b9282008-07-06 05:20:311854<tt>-p</tt>, and are meant for human consumption.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591855<div class="paragraph"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output
Junio C Hamano3a702342007-12-12 21:34:021856formats the pathnames compactly by combining common prefix and suffix of
1857the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to
Junio C Hamanoba4b9282008-07-06 05:20:311858<tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021859<div class="listingblock">
1860<div class="content">
1861<pre><tt>arch/{i386 =&gt; x86}/Makefile | 4 +--</tt></pre>
1862</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591863<div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed
Junio C Hamano3a702342007-12-12 21:34:021864for easier machine consumption. An entry in <tt>--numstat</tt> output looks
Junio C Hamanoba4b9282008-07-06 05:20:311865like this:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021866<div class="listingblock">
1867<div class="content">
1868<pre><tt>1 2 README
18693 1 arch/{i386 =&gt; x86}/Makefile</tt></pre>
1870</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591871<div class="paragraph"><p>That is, from left to right:</p></div>
1872<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:021873<li>
1874<p>
1875the number of added lines;
1876</p>
1877</li>
1878<li>
1879<p>
1880a tab;
1881</p>
1882</li>
1883<li>
1884<p>
1885the number of deleted lines;
1886</p>
1887</li>
1888<li>
1889<p>
1890a tab;
1891</p>
1892</li>
1893<li>
1894<p>
1895pathname (possibly with rename/copy information);
1896</p>
1897</li>
1898<li>
1899<p>
1900a newline.
1901</p>
1902</li>
Junio C Hamanoba4b9282008-07-06 05:20:311903</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591904<div class="paragraph"><p>When <tt>-z</tt> output option is in effect, the output is formatted this way:</p></div>
Junio C Hamano3a702342007-12-12 21:34:021905<div class="listingblock">
1906<div class="content">
1907<pre><tt>1 2 README NUL
19083 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre>
1909</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591910<div class="paragraph"><p>That is:</p></div>
1911<div class="olist arabic"><ol class="arabic">
Junio C Hamano3a702342007-12-12 21:34:021912<li>
1913<p>
1914the number of added lines;
1915</p>
1916</li>
1917<li>
1918<p>
1919a tab;
1920</p>
1921</li>
1922<li>
1923<p>
1924the number of deleted lines;
1925</p>
1926</li>
1927<li>
1928<p>
1929a tab;
1930</p>
1931</li>
1932<li>
1933<p>
1934a NUL (only exists if renamed/copied);
1935</p>
1936</li>
1937<li>
1938<p>
1939pathname in preimage;
1940</p>
1941</li>
1942<li>
1943<p>
1944a NUL (only exists if renamed/copied);
1945</p>
1946</li>
1947<li>
1948<p>
1949pathname in postimage (only exists if renamed/copied);
1950</p>
1951</li>
1952<li>
1953<p>
1954a NUL.
1955</p>
1956</li>
Junio C Hamanoba4b9282008-07-06 05:20:311957</ol></div>
Junio C Hamano68cf15a2010-11-06 01:01:591958<div class="paragraph"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow
Junio C Hamano3a702342007-12-12 21:34:021959scripts that read the output to tell if the current record being read is
1960a single-path record or a rename/copy record without reading ahead.
1961After reading added and deleted lines, reading up to <tt>NUL</tt> would yield
Junio C Hamanoba4b9282008-07-06 05:20:311962the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div>
Junio C Hamano3a702342007-12-12 21:34:021963</div>
Junio C Hamanoba4b9282008-07-06 05:20:311964<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231965<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591966<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231967</div>
Junio C Hamano7bd050f2011-09-22 06:32:221968</div>
1969<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231970<div id="footer">
1971<div id="footer-text">
Junio C Hamano02194af2011-11-17 20:33:591972Last updated 2011-11-15 13:45:02 PDT
Junio C Hamano1a4e8412005-12-27 08:17:231973</div>
1974</div>
1975</body>
1976</html>