Autogenerated HTML docs for v2.47.0-72-gef8ce8
[git-htmldocs.git] / git-diff.html
blob87191067c3bbae28574141bd2a5420e945e693dd
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3 <head>
4 <meta charset="UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6 <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7 <meta name="generator" content="Asciidoctor 2.0.20"/>
8 <title>git-diff(1)</title>
9 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/>
10 <style>
11 /*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
12 /* Uncomment the following line when using as a custom stylesheet */
13 /* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */
14 html{font-family:sans-serif;-webkit-text-size-adjust:100%}
15 a{background:none}
16 a:focus{outline:thin dotted}
17 a:active,a:hover{outline:0}
18 h1{font-size:2em;margin:.67em 0}
19 b,strong{font-weight:bold}
20 abbr{font-size:.9em}
21 abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none}
22 dfn{font-style:italic}
23 hr{height:0}
24 mark{background:#ff0;color:#000}
25 code,kbd,pre,samp{font-family:monospace;font-size:1em}
26 pre{white-space:pre-wrap}
27 q{quotes:"\201C" "\201D" "\2018" "\2019"}
28 small{font-size:80%}
29 sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
30 sup{top:-.5em}
31 sub{bottom:-.25em}
32 img{border:0}
33 svg:not(:root){overflow:hidden}
34 figure{margin:0}
35 audio,video{display:inline-block}
36 audio:not([controls]){display:none;height:0}
37 fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
38 legend{border:0;padding:0}
39 button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
40 button,input{line-height:normal}
41 button,select{text-transform:none}
42 button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
43 button[disabled],html input[disabled]{cursor:default}
44 input[type=checkbox],input[type=radio]{padding:0}
45 button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
46 textarea{overflow:auto;vertical-align:top}
47 table{border-collapse:collapse;border-spacing:0}
48 *,::before,::after{box-sizing:border-box}
49 html,body{font-size:100%}
50 body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
51 a:hover{cursor:pointer}
52 img,object,embed{max-width:100%;height:auto}
53 object,embed{height:100%}
54 img{-ms-interpolation-mode:bicubic}
55 .left{float:left!important}
56 .right{float:right!important}
57 .text-left{text-align:left!important}
58 .text-right{text-align:right!important}
59 .text-center{text-align:center!important}
60 .text-justify{text-align:justify!important}
61 .hide{display:none}
62 img,object,svg{display:inline-block;vertical-align:middle}
63 textarea{height:auto;min-height:50px}
64 select{width:100%}
65 .subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
66 div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0}
67 a{color:#2156a5;text-decoration:underline;line-height:inherit}
68 a:hover,a:focus{color:#1d4b8f}
69 a img{border:0}
70 p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
71 p aside{font-size:.875em;line-height:1.35;font-style:italic}
72 h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
73 h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
74 h1{font-size:2.125em}
75 h2{font-size:1.6875em}
76 h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
77 h4,h5{font-size:1.125em}
78 h6{font-size:1em}
79 hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em}
80 em,i{font-style:italic;line-height:inherit}
81 strong,b{font-weight:bold;line-height:inherit}
82 small{font-size:60%;line-height:inherit}
83 code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
84 ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
85 ul,ol{margin-left:1.5em}
86 ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0}
87 ul.circle{list-style-type:circle}
88 ul.disc{list-style-type:disc}
89 ul.square{list-style-type:square}
90 ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
91 ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
92 dl dt{margin-bottom:.3125em;font-weight:bold}
93 dl dd{margin-bottom:1.25em}
94 blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
95 blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
96 @media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
97 h1{font-size:2.75em}
98 h2{font-size:2.3125em}
99 h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
100 h4{font-size:1.4375em}}
101 table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal}
102 table thead,table tfoot{background:#f7f8f7}
103 table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
104 table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
105 table tr.even,table tr.alt{background:#f8f8f7}
106 table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6}
107 h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
108 h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
109 .center{margin-left:auto;margin-right:auto}
110 .stretch{width:100%}
111 .clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
112 .clearfix::after,.float-group::after{clear:both}
113 :not(pre).nobreak{word-wrap:normal}
114 :not(pre).nowrap{white-space:nowrap}
115 :not(pre).pre-wrap{white-space:pre-wrap}
116 :not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
117 pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed}
118 pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
119 pre>code{display:block}
120 pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
121 em em{font-style:normal}
122 strong strong{font-weight:400}
123 .keyseq{color:rgba(51,51,51,.8)}
124 kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
125 .keyseq kbd:first-child{margin-left:0}
126 .keyseq kbd:last-child{margin-right:0}
127 .menuseq,.menuref{color:#000}
128 .menuseq b:not(.caret),.menuref{font-weight:inherit}
129 .menuseq{word-spacing:-.02em}
130 .menuseq b.caret{font-size:1.25em;line-height:.8}
131 .menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
132 b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
133 b.button::before{content:"[";padding:0 3px 0 2px}
134 b.button::after{content:"]";padding:0 2px 0 3px}
135 p a>code:hover{color:rgba(0,0,0,.9)}
136 #header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
137 #header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
138 #header::after,#content::after,#footnotes::after,#footer::after{clear:both}
139 #content{margin-top:1.25em}
140 #content::before{content:none}
141 #header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
142 #header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
143 #header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
144 #header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap}
145 #header .details span:first-child{margin-left:-.125em}
146 #header .details span.email a{color:rgba(0,0,0,.85)}
147 #header .details br{display:none}
148 #header .details br+span::before{content:"\00a0\2013\00a0"}
149 #header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
150 #header .details br+span#revremark::before{content:"\00a0|\00a0"}
151 #header #revnumber{text-transform:capitalize}
152 #header #revnumber::after{content:"\00a0"}
153 #content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
154 #toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em}
155 #toc>ul{margin-left:.125em}
156 #toc ul.sectlevel0>li>a{font-style:italic}
157 #toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
158 #toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
159 #toc li{line-height:1.3334;margin-top:.3334em}
160 #toc a{text-decoration:none}
161 #toc a:active{text-decoration:underline}
162 #toctitle{color:#7a2518;font-size:1.2em}
163 @media screen and (min-width:768px){#toctitle{font-size:1.375em}
164 body.toc2{padding-left:15em;padding-right:0}
165 #toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
166 #toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
167 #toc.toc2>ul{font-size:.9em;margin-bottom:0}
168 #toc.toc2 ul ul{margin-left:0;padding-left:1em}
169 #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
170 body.toc2.toc-right{padding-left:0;padding-right:15em}
171 body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
172 @media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
173 #toc.toc2{width:20em}
174 #toc.toc2 #toctitle{font-size:1.375em}
175 #toc.toc2>ul{font-size:.95em}
176 #toc.toc2 ul ul{padding-left:1.25em}
177 body.toc2.toc-right{padding-left:0;padding-right:20em}}
178 #content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px}
179 #content #toc>:first-child{margin-top:0}
180 #content #toc>:last-child{margin-bottom:0}
181 #footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em}
182 #footer-text{color:hsla(0,0%,100%,.8);line-height:1.44}
183 #content{margin-bottom:.625em}
184 .sect1{padding-bottom:.625em}
185 @media screen and (min-width:768px){#content{margin-bottom:1.25em}
186 .sect1{padding-bottom:1.25em}}
187 .sect1:last-child{padding-bottom:0}
188 .sect1+.sect1{border-top:1px solid #e7e7e9}
189 #content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
190 #content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
191 #content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
192 #content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
193 #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
194 details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
195 details{margin-left:1.25rem}
196 details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent}
197 details>summary::-webkit-details-marker{display:none}
198 details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)}
199 details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)}
200 details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem}
201 .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
202 table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
203 .paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
204 .admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
205 .admonitionblock>table td.icon{text-align:center;width:80px}
206 .admonitionblock>table td.icon img{max-width:none}
207 .admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
208 .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
209 .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
210 .exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
211 .sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
212 .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
213 .exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
214 .exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
215 .literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
216 @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
217 @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
218 .literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
219 .literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
220 .listingblock>.content{position:relative}
221 .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5}
222 .listingblock:hover code[data-lang]::before{display:block}
223 .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
224 .listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
225 .listingblock pre.highlightjs{padding:0}
226 .listingblock pre.highlightjs>code{padding:1em;border-radius:4px}
227 .listingblock pre.prettyprint{border-width:0}
228 .prettyprint{background:#f7f7f8}
229 pre.prettyprint .linenums{line-height:1.45;margin-left:2em}
230 pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0}
231 pre.prettyprint li code[data-lang]::before{opacity:1}
232 pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
233 table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none}
234 table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal}
235 table.linenotable td.code{padding-left:.75em}
236 table.linenotable td.linenos,pre.pygments .linenos{border-right:1px solid;opacity:.35;padding-right:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
237 pre.pygments span.linenos{display:inline-block;margin-right:.75em}
238 .quoteblock{margin:0 1em 1.25em 1.5em;display:table}
239 .quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em}
240 .quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
241 .quoteblock blockquote{margin:0;padding:0;border:0}
242 .quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
243 .quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
244 .quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
245 .verseblock{margin:0 1em 1.25em}
246 .verseblock pre{font-family:"Open Sans","DejaVu Sans",sans-serif;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
247 .verseblock pre strong{font-weight:400}
248 .verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
249 .quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
250 .quoteblock .attribution br,.verseblock .attribution br{display:none}
251 .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
252 .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
253 .quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0}
254 .quoteblock.abstract{margin:0 1em 1.25em;display:block}
255 .quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
256 .quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
257 .quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0}
258 .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
259 .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0}
260 p.tableblock:last-child{margin-bottom:0}
261 td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere}
262 td.tableblock>.content>:last-child{margin-bottom:-1.25em}
263 table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
264 table.grid-all>*>tr>*{border-width:1px}
265 table.grid-cols>*>tr>*{border-width:0 1px}
266 table.grid-rows>*>tr>*{border-width:1px 0}
267 table.frame-all{border-width:1px}
268 table.frame-ends{border-width:1px 0}
269 table.frame-sides{border-width:0 1px}
270 table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0}
271 table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0}
272 table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0}
273 table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0}
274 table.stripes-all>*>tr,table.stripes-odd>*>tr:nth-of-type(odd),table.stripes-even>*>tr:nth-of-type(even),table.stripes-hover>*>tr:hover{background:#f8f8f7}
275 th.halign-left,td.halign-left{text-align:left}
276 th.halign-right,td.halign-right{text-align:right}
277 th.halign-center,td.halign-center{text-align:center}
278 th.valign-top,td.valign-top{vertical-align:top}
279 th.valign-bottom,td.valign-bottom{vertical-align:bottom}
280 th.valign-middle,td.valign-middle{vertical-align:middle}
281 table thead th,table tfoot th{font-weight:bold}
282 tbody tr th{background:#f7f8f7}
283 tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
284 p.tableblock>code:only-child{background:none;padding:0}
285 p.tableblock{font-size:1em}
286 ol{margin-left:1.75em}
287 ul li ol{margin-left:1.5em}
288 dl dd{margin-left:1.125em}
289 dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
290 li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
291 ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
292 ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
293 ul.unstyled,ol.unstyled{margin-left:0}
294 li>p:empty:only-child::before{content:"";display:inline-block}
295 ul.checklist>li>p:first-child{margin-left:-1em}
296 ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
297 ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em}
298 ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
299 ul.inline>li{margin-left:1.25em}
300 .unstyled dl dt{font-weight:400;font-style:normal}
301 ol.arabic{list-style-type:decimal}
302 ol.decimal{list-style-type:decimal-leading-zero}
303 ol.loweralpha{list-style-type:lower-alpha}
304 ol.upperalpha{list-style-type:upper-alpha}
305 ol.lowerroman{list-style-type:lower-roman}
306 ol.upperroman{list-style-type:upper-roman}
307 ol.lowergreek{list-style-type:lower-greek}
308 .hdlist>table,.colist>table{border:0;background:none}
309 .hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
310 td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
311 td.hdlist1{font-weight:bold;padding-bottom:1.25em}
312 td.hdlist2{word-wrap:anywhere}
313 .literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
314 .colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
315 .colist td:not([class]):first-child img{max-width:none}
316 .colist td:not([class]):last-child{padding:.25em 0}
317 .thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd}
318 .imageblock.left{margin:.25em .625em 1.25em 0}
319 .imageblock.right{margin:.25em 0 1.25em .625em}
320 .imageblock>.title{margin-bottom:0}
321 .imageblock.thumb,.imageblock.th{border-width:6px}
322 .imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
323 .image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
324 .image.left{margin-right:.625em}
325 .image.right{margin-left:.625em}
326 a.image{text-decoration:none;display:inline-block}
327 a.image object{pointer-events:none}
328 sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
329 sup.footnote a,sup.footnoteref a{text-decoration:none}
330 sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
331 #footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
332 #footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
333 #footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
334 #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
335 #footnotes .footnote:last-of-type{margin-bottom:0}
336 #content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
337 div.unbreakable{page-break-inside:avoid}
338 .big{font-size:larger}
339 .small{font-size:smaller}
340 .underline{text-decoration:underline}
341 .overline{text-decoration:overline}
342 .line-through{text-decoration:line-through}
343 .aqua{color:#00bfbf}
344 .aqua-background{background:#00fafa}
345 .black{color:#000}
346 .black-background{background:#000}
347 .blue{color:#0000bf}
348 .blue-background{background:#0000fa}
349 .fuchsia{color:#bf00bf}
350 .fuchsia-background{background:#fa00fa}
351 .gray{color:#606060}
352 .gray-background{background:#7d7d7d}
353 .green{color:#006000}
354 .green-background{background:#007d00}
355 .lime{color:#00bf00}
356 .lime-background{background:#00fa00}
357 .maroon{color:#600000}
358 .maroon-background{background:#7d0000}
359 .navy{color:#000060}
360 .navy-background{background:#00007d}
361 .olive{color:#606000}
362 .olive-background{background:#7d7d00}
363 .purple{color:#600060}
364 .purple-background{background:#7d007d}
365 .red{color:#bf0000}
366 .red-background{background:#fa0000}
367 .silver{color:#909090}
368 .silver-background{background:#bcbcbc}
369 .teal{color:#006060}
370 .teal-background{background:#007d7d}
371 .white{color:#bfbfbf}
372 .white-background{background:#fafafa}
373 .yellow{color:#bfbf00}
374 .yellow-background{background:#fafa00}
375 span.icon>.fa{cursor:default}
376 a span.icon>.fa{cursor:inherit}
377 .admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
378 .admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
379 .admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
380 .admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
381 .admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
382 .admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
383 .conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
384 .conum[data-value] *{color:#fff!important}
385 .conum[data-value]+b{display:none}
386 .conum[data-value]::after{content:attr(data-value)}
387 pre .conum[data-value]{position:relative;top:-.125em}
388 b.conum *{color:inherit!important}
389 .conum:not([data-value]):empty{display:none}
390 dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
391 h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
392 p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
393 p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
394 p{margin-bottom:1.25rem}
395 .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
396 .exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
397 .print-only{display:none!important}
398 @page{margin:1.25cm .75cm}
399 @media print{*{box-shadow:none!important;text-shadow:none!important}
400 html{font-size:80%}
401 a{color:inherit!important;text-decoration:underline!important}
402 a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
403 a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
404 abbr[title]{border-bottom:1px dotted}
405 abbr[title]::after{content:" (" attr(title) ")"}
406 pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
407 thead{display:table-header-group}
408 svg{max-width:100%}
409 p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
410 h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
411 #header,#content,#footnotes,#footer{max-width:none}
412 #toc,.sidebarblock,.exampleblock>.content{background:none!important}
413 #toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
414 body.book #header{text-align:center}
415 body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
416 body.book #header .details{border:0!important;display:block;padding:0!important}
417 body.book #header .details span:first-child{margin-left:0!important}
418 body.book #header .details br{display:block}
419 body.book #header .details br+span::before{content:none!important}
420 body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
421 body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
422 .listingblock code[data-lang]::before{display:block}
423 #footer{padding:0 .9375em}
424 .hide-on-print{display:none!important}
425 .print-only{display:block!important}
426 .hide-for-print{display:none!important}
427 .show-for-print{display:inherit!important}}
428 @media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem}
429 .sect1{padding:0!important}
430 .sect1+.sect1{border:0}
431 #footer{background:none}
432 #footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
433 @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
434 </style>
435 <style>
436 pre>code {
437 display: inline;
439 </style>
440 </head>
441 <body class="manpage">
442 <div id="header">
443 <h1>git-diff(1) Manual Page</h1>
444 <h2 id="_name">NAME</h2>
445 <div class="sectionbody">
446 <p>git-diff - Show changes between commits, commit and working tree, etc</p>
447 </div>
448 </div>
449 <div id="content">
450 <div class="sect1">
451 <h2 id="_synopsis">SYNOPSIS</h2>
452 <div class="sectionbody">
453 <div class="verseblock">
454 <pre class="content"><em>git diff</em> [&lt;options&gt;] [&lt;commit&gt;] [--] [&lt;path&gt;&#8230;&#8203;]
455 <em>git diff</em> [&lt;options&gt;] --cached [--merge-base] [&lt;commit&gt;] [--] [&lt;path&gt;&#8230;&#8203;]
456 <em>git diff</em> [&lt;options&gt;] [--merge-base] &lt;commit&gt; [&lt;commit&gt;&#8230;&#8203;] &lt;commit&gt; [--] [&lt;path&gt;&#8230;&#8203;]
457 <em>git diff</em> [&lt;options&gt;] &lt;commit&gt;&#8230;&#8203;&lt;commit&gt; [--] [&lt;path&gt;&#8230;&#8203;]
458 <em>git diff</em> [&lt;options&gt;] &lt;blob&gt; &lt;blob&gt;
459 <em>git diff</em> [&lt;options&gt;] --no-index [--] &lt;path&gt; &lt;path&gt;</pre>
460 </div>
461 </div>
462 </div>
463 <div class="sect1">
464 <h2 id="_description">DESCRIPTION</h2>
465 <div class="sectionbody">
466 <div class="paragraph">
467 <p>Show changes between the working tree and the index or a tree, changes
468 between the index and a tree, changes between two trees, changes resulting
469 from a merge, changes between two blob objects, or changes between two
470 files on disk.</p>
471 </div>
472 <div class="dlist">
473 <dl>
474 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] [--] [&lt;path&gt;&#8230;&#8203;]</dt>
475 <dd>
476 <p>This form is to view the changes you made relative to
477 the index (staging area for the next commit). In other
478 words, the differences are what you <em>could</em> tell Git to
479 further add to the index but you still haven&#8217;t. You can
480 stage these changes by using <a href="git-add.html">git-add(1)</a>.</p>
481 </dd>
482 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] --no-index [--] &lt;path&gt; &lt;path&gt;</dt>
483 <dd>
484 <p>This form is to compare the given two paths on the
485 filesystem. You can omit the <code>--no-index</code> option when
486 running the command in a working tree controlled by Git and
487 at least one of the paths points outside the working tree,
488 or when running the command outside a working tree
489 controlled by Git. This form implies <code>--exit-code</code>.</p>
490 </dd>
491 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] --cached [--merge-base] [&lt;commit&gt;] [--] [&lt;path&gt;&#8230;&#8203;]</dt>
492 <dd>
493 <p>This form is to view the changes you staged for the next
494 commit relative to the named &lt;commit&gt;. Typically you
495 would want comparison with the latest commit, so if you
496 do not give &lt;commit&gt;, it defaults to HEAD.
497 If HEAD does not exist (e.g. unborn branches) and
498 &lt;commit&gt; is not given, it shows all staged changes.
499 --staged is a synonym of --cached.</p>
500 <div class="paragraph">
501 <p>If --merge-base is given, instead of using &lt;commit&gt;, use the merge base
502 of &lt;commit&gt; and HEAD. <code>git</code> <code>diff</code> <code>--cached</code> <code>--merge-base</code> <code>A</code> is equivalent to
503 <code>git</code> <code>diff</code> <code>--cached</code> <code>$</code>(<code>git</code> <code>merge-base</code> <code>A</code> <code>HEAD</code>).</p>
504 </div>
505 </dd>
506 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] [--merge-base] &lt;commit&gt; [--] [&lt;path&gt;&#8230;&#8203;]</dt>
507 <dd>
508 <p>This form is to view the changes you have in your
509 working tree relative to the named &lt;commit&gt;. You can
510 use HEAD to compare it with the latest commit, or a
511 branch name to compare with the tip of a different
512 branch.</p>
513 <div class="paragraph">
514 <p>If --merge-base is given, instead of using &lt;commit&gt;, use the merge base
515 of &lt;commit&gt; and HEAD. <code>git</code> <code>diff</code> <code>--merge-base</code> <code>A</code> is equivalent to
516 <code>git</code> <code>diff</code> <code>$</code>(<code>git</code> <code>merge-base</code> <code>A</code> <code>HEAD</code>).</p>
517 </div>
518 </dd>
519 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] [--merge-base] &lt;commit&gt; &lt;commit&gt; [--] [&lt;path&gt;&#8230;&#8203;]</dt>
520 <dd>
521 <p>This is to view the changes between two arbitrary
522 &lt;commit&gt;.</p>
523 <div class="paragraph">
524 <p>If --merge-base is given, use the merge base of the two commits for the
525 "before" side. <code>git</code> <code>diff</code> <code>--merge-base</code> <code>A</code> <code>B</code> is equivalent to
526 <code>git</code> <code>diff</code> <code>$</code>(<code>git</code> <code>merge-base</code> <code>A</code> <code>B</code>) <code>B</code>.</p>
527 </div>
528 </dd>
529 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] &lt;commit&gt; &lt;commit&gt;&#8230;&#8203; &lt;commit&gt; [--] [&lt;path&gt;&#8230;&#8203;]</dt>
530 <dd>
531 <p>This form is to view the results of a merge commit. The first
532 listed &lt;commit&gt; must be the merge itself; the remaining two or
533 more commits should be its parents. Convenient ways to produce
534 the desired set of revisions are to use the suffixes <code>^@</code> and
535 <code>^</code>!. If A is a merge commit, then <code>git</code> <code>diff</code> <code>A</code> <code>A^@</code>,
536 <code>git</code> <code>diff</code> <code>A^</code>! and <code>git</code> <code>show</code> <code>A</code> all give the same combined diff.</p>
537 </dd>
538 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] &lt;commit&gt;..&lt;commit&gt; [--] [&lt;path&gt;&#8230;&#8203;]</dt>
539 <dd>
540 <p>This is synonymous to the earlier form (without the ..) for
541 viewing the changes between two arbitrary &lt;commit&gt;. If &lt;commit&gt; on
542 one side is omitted, it will have the same effect as
543 using HEAD instead.</p>
544 </dd>
545 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] &lt;commit&gt;...&lt;commit&gt; [--] [&lt;path&gt;&#8230;&#8203;]</dt>
546 <dd>
547 <p>This form is to view the changes on the branch containing
548 and up to the second &lt;commit&gt;, starting at a common ancestor
549 of both &lt;commit&gt;. <code>git</code> <code>diff</code> <code>A</code><code>...</code><code>B</code> is equivalent to
550 <code>git</code> <code>diff</code> <code>$</code>(<code>git</code> <code>merge-base</code> <code>A</code> <code>B</code>) <code>B</code>. You can omit any one
551 of &lt;commit&gt;, which has the same effect as using HEAD instead.</p>
552 </dd>
553 </dl>
554 </div>
555 <div class="paragraph">
556 <p>Just in case you are doing something exotic, it should be
557 noted that all of the &lt;commit&gt; in the above description, except
558 in the <code>--merge-base</code> case and in the last two forms that use ..
559 notations, can be any &lt;tree&gt;. A tree of interest is the one pointed to
560 by the ref named <code>AUTO_MERGE</code>, which is written by the <em>ort</em> merge
561 strategy upon hitting merge conflicts (see <a href="git-merge.html">git-merge(1)</a>).
562 Comparing the working tree with <code>AUTO_MERGE</code> shows changes you&#8217;ve made
563 so far to resolve textual conflicts (see the examples below).</p>
564 </div>
565 <div class="paragraph">
566 <p>For a more complete list of ways to spell &lt;commit&gt;, see
567 "SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>.
568 However, "diff" is about comparing two <em>endpoints</em>, not ranges,
569 and the range notations (<em>&lt;commit&gt;</em><code>..</code><em>&lt;commit&gt;</em> and
570 <em>&lt;commit&gt;</em><code>...</code><em>&lt;commit&gt;</em>) do not mean a range as defined in the
571 "SPECIFYING RANGES" section in <a href="gitrevisions.html">gitrevisions(7)</a>.</p>
572 </div>
573 <div class="dlist">
574 <dl>
575 <dt class="hdlist1"><em>git diff</em> [&lt;options&gt;] &lt;blob&gt; &lt;blob&gt;</dt>
576 <dd>
577 <p>This form is to view the differences between the raw
578 contents of two blob objects.</p>
579 </dd>
580 </dl>
581 </div>
582 </div>
583 </div>
584 <div class="sect1">
585 <h2 id="_options">OPTIONS</h2>
586 <div class="sectionbody">
587 <div class="dlist">
588 <dl>
589 <dt class="hdlist1">-p</dt>
590 <dt class="hdlist1">-u</dt>
591 <dt class="hdlist1">--patch</dt>
592 <dd>
593 <p>Generate patch (see <a href="#generate_patch_text_with_p">Generating patch text with -p</a>).
594 This is the default.</p>
595 </dd>
596 <dt class="hdlist1">-s</dt>
597 <dt class="hdlist1">--no-patch</dt>
598 <dd>
599 <p>Suppress all output from the diff machinery. Useful for
600 commands like <code>git</code> <code>show</code> that show the patch by default to
601 squelch their output, or to cancel the effect of options like
602 <code>--patch</code>, <code>--stat</code> earlier on the command line in an alias.</p>
603 </dd>
604 <dt class="hdlist1">-U&lt;n&gt;</dt>
605 <dt class="hdlist1">--unified=&lt;n&gt;</dt>
606 <dd>
607 <p>Generate diffs with &lt;n&gt; lines of context instead of
608 the usual three.
609 Implies <code>--patch</code>.</p>
610 </dd>
611 <dt class="hdlist1">--output=&lt;file&gt;</dt>
612 <dd>
613 <p>Output to a specific file instead of stdout.</p>
614 </dd>
615 <dt class="hdlist1">--output-indicator-new=&lt;char&gt;</dt>
616 <dt class="hdlist1">--output-indicator-old=&lt;char&gt;</dt>
617 <dt class="hdlist1">--output-indicator-context=&lt;char&gt;</dt>
618 <dd>
619 <p>Specify the character used to indicate new, old or context
620 lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and
621 ' ' respectively.</p>
622 </dd>
623 <dt class="hdlist1">--raw</dt>
624 <dd>
625 <p>Generate the diff in raw format.</p>
626 </dd>
627 <dt class="hdlist1">--patch-with-raw</dt>
628 <dd>
629 <p>Synonym for <code>-p</code> <code>--raw</code>.</p>
630 </dd>
631 <dt class="hdlist1">--indent-heuristic</dt>
632 <dd>
633 <p>Enable the heuristic that shifts diff hunk boundaries to make patches
634 easier to read. This is the default.</p>
635 </dd>
636 <dt class="hdlist1">--no-indent-heuristic</dt>
637 <dd>
638 <p>Disable the indent heuristic.</p>
639 </dd>
640 <dt class="hdlist1">--minimal</dt>
641 <dd>
642 <p>Spend extra time to make sure the smallest possible
643 diff is produced.</p>
644 </dd>
645 <dt class="hdlist1">--patience</dt>
646 <dd>
647 <p>Generate a diff using the "patience diff" algorithm.</p>
648 </dd>
649 <dt class="hdlist1">--histogram</dt>
650 <dd>
651 <p>Generate a diff using the "histogram diff" algorithm.</p>
652 </dd>
653 <dt class="hdlist1">--anchored=&lt;text&gt;</dt>
654 <dd>
655 <p>Generate a diff using the "anchored diff" algorithm.</p>
656 <div class="paragraph">
657 <p>This option may be specified more than once.</p>
658 </div>
659 <div class="paragraph">
660 <p>If a line exists in both the source and destination, exists only once,
661 and starts with this text, this algorithm attempts to prevent it from
662 appearing as a deletion or addition in the output. It uses the "patience
663 diff" algorithm internally.</p>
664 </div>
665 </dd>
666 <dt class="hdlist1">--diff-algorithm={patience|minimal|histogram|myers}</dt>
667 <dd>
668 <p>Choose a diff algorithm. The variants are as follows:</p>
669 <div class="openblock">
670 <div class="content">
671 <div class="dlist">
672 <dl>
673 <dt class="hdlist1"><code>default</code>, <code>myers</code></dt>
674 <dd>
675 <p>The basic greedy diff algorithm. Currently, this is the default.</p>
676 </dd>
677 <dt class="hdlist1"><code>minimal</code></dt>
678 <dd>
679 <p>Spend extra time to make sure the smallest possible diff is
680 produced.</p>
681 </dd>
682 <dt class="hdlist1"><code>patience</code></dt>
683 <dd>
684 <p>Use "patience diff" algorithm when generating patches.</p>
685 </dd>
686 <dt class="hdlist1"><code>histogram</code></dt>
687 <dd>
688 <p>This algorithm extends the patience algorithm to "support
689 low-occurrence common elements".</p>
690 </dd>
691 </dl>
692 </div>
693 </div>
694 </div>
695 <div class="paragraph">
696 <p>For instance, if you configured the <code>diff.algorithm</code> variable to a
697 non-default value and want to use the default one, then you
698 have to use <code>--diff-algorithm=default</code> option.</p>
699 </div>
700 </dd>
701 <dt class="hdlist1">--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]</dt>
702 <dd>
703 <p>Generate a diffstat. By default, as much space as necessary
704 will be used for the filename part, and the rest for the graph
705 part. Maximum width defaults to terminal width, or 80 columns
706 if not connected to a terminal, and can be overridden by
707 <em>&lt;width&gt;</em>. The width of the filename part can be limited by
708 giving another width <em>&lt;name-width&gt;</em> after a comma or by setting
709 <code>diff.statNameWidth=</code><em>&lt;width&gt;</em>. The width of the graph part can be
710 limited by using <code>--stat-graph-width=</code><em>&lt;width&gt;</em> or by setting
711 <code>diff.statGraphWidth=</code><em>&lt;width&gt;</em>. Using <code>--stat</code> or
712 <code>--stat-graph-width</code> affects all commands generating a stat graph,
713 while setting <code>diff.statNameWidth</code> or <code>diff.statGraphWidth</code>
714 does not affect <code>git</code> <code>format-patch</code>.
715 By giving a third parameter <em>&lt;count&gt;</em>, you can limit the output to
716 the first <em>&lt;count&gt;</em> lines, followed by ... if there are more.</p>
717 <div class="paragraph">
718 <p>These parameters can also be set individually with <code>--stat-width=</code><em>&lt;width&gt;</em>,
719 <code>--stat-name-width=</code><em>&lt;name-width&gt;</em> and <code>--stat-count=</code><em>&lt;count&gt;</em>.</p>
720 </div>
721 </dd>
722 <dt class="hdlist1">--compact-summary</dt>
723 <dd>
724 <p>Output a condensed summary of extended header information such
725 as file creations or deletions ("new" or "gone", optionally "+l"
726 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
727 or removing executable bit respectively) in diffstat. The
728 information is put between the filename part and the graph
729 part. Implies <code>--stat</code>.</p>
730 </dd>
731 <dt class="hdlist1">--numstat</dt>
732 <dd>
733 <p>Similar to <code>--stat</code>, but shows number of added and
734 deleted lines in decimal notation and pathname without
735 abbreviation, to make it more machine friendly. For
736 binary files, outputs two <code>-</code> instead of saying
737 <code>0</code> <code>0</code>.</p>
738 </dd>
739 <dt class="hdlist1">--shortstat</dt>
740 <dd>
741 <p>Output only the last line of the <code>--stat</code> format containing total
742 number of modified files, as well as number of added and deleted
743 lines.</p>
744 </dd>
745 <dt class="hdlist1">-X[&lt;param1,param2,&#8230;&#8203;&gt;]</dt>
746 <dt class="hdlist1">--dirstat[=&lt;param1,param2,&#8230;&#8203;&gt;]</dt>
747 <dd>
748 <p>Output the distribution of relative amount of changes for each
749 sub-directory. The behavior of <code>--dirstat</code> can be customized by
750 passing it a comma separated list of parameters.
751 The defaults are controlled by the <code>diff.dirstat</code> configuration
752 variable (see <a href="git-config.html">git-config(1)</a>).
753 The following parameters are available:</p>
754 <div class="openblock">
755 <div class="content">
756 <div class="dlist">
757 <dl>
758 <dt class="hdlist1"><code>changes</code></dt>
759 <dd>
760 <p>Compute the dirstat numbers by counting the lines that have been
761 removed from the source, or added to the destination. This ignores
762 the amount of pure code movements within a file. In other words,
763 rearranging lines in a file is not counted as much as other changes.
764 This is the default behavior when no parameter is given.</p>
765 </dd>
766 <dt class="hdlist1"><code>lines</code></dt>
767 <dd>
768 <p>Compute the dirstat numbers by doing the regular line-based diff
769 analysis, and summing the removed/added line counts. (For binary
770 files, count 64-byte chunks instead, since binary files have no
771 natural concept of lines). This is a more expensive <code>--dirstat</code>
772 behavior than the <code>changes</code> behavior, but it does count rearranged
773 lines within a file as much as other changes. The resulting output
774 is consistent with what you get from the other <code>--</code>*stat options.</p>
775 </dd>
776 <dt class="hdlist1"><code>files</code></dt>
777 <dd>
778 <p>Compute the dirstat numbers by counting the number of files changed.
779 Each changed file counts equally in the dirstat analysis. This is
780 the computationally cheapest <code>--dirstat</code> behavior, since it does
781 not have to look at the file contents at all.</p>
782 </dd>
783 <dt class="hdlist1"><code>cumulative</code></dt>
784 <dd>
785 <p>Count changes in a child directory for the parent directory as well.
786 Note that when using <code>cumulative</code>, the sum of the percentages
787 reported may exceed 100%. The default (non-cumulative) behavior can
788 be specified with the <code>noncumulative</code> parameter.</p>
789 </dd>
790 <dt class="hdlist1">&lt;limit&gt;</dt>
791 <dd>
792 <p>An integer parameter specifies a cut-off percent (3% by default).
793 Directories contributing less than this percentage of the changes
794 are not shown in the output.</p>
795 </dd>
796 </dl>
797 </div>
798 </div>
799 </div>
800 <div class="paragraph">
801 <p>Example: The following will count changed files, while ignoring
802 directories with less than 10% of the total amount of changed files,
803 and accumulating child directory counts in the parent directories:
804 <code>--dirstat=files,10,cumulative</code>.</p>
805 </div>
806 </dd>
807 <dt class="hdlist1">--cumulative</dt>
808 <dd>
809 <p>Synonym for --dirstat=cumulative</p>
810 </dd>
811 <dt class="hdlist1">--dirstat-by-file[=&lt;param1,param2&gt;&#8230;&#8203;]</dt>
812 <dd>
813 <p>Synonym for --dirstat=files,&lt;param1&gt;,&lt;param2&gt;&#8230;&#8203;</p>
814 </dd>
815 <dt class="hdlist1">--summary</dt>
816 <dd>
817 <p>Output a condensed summary of extended header information
818 such as creations, renames and mode changes.</p>
819 </dd>
820 <dt class="hdlist1">--patch-with-stat</dt>
821 <dd>
822 <p>Synonym for <code>-p</code> <code>--stat</code>.</p>
823 </dd>
824 <dt class="hdlist1">-z</dt>
825 <dd>
826 <p>When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been
827 given, do not munge pathnames and use NULs as output field terminators.</p>
828 <div class="paragraph">
829 <p>Without this option, pathnames with "unusual" characters are quoted as
830 explained for the configuration variable <code>core.quotePath</code> (see
831 <a href="git-config.html">git-config(1)</a>).</p>
832 </div>
833 </dd>
834 <dt class="hdlist1">--name-only</dt>
835 <dd>
836 <p>Show only the name of each changed file in the post-image tree.
837 The file names are often encoded in UTF-8.
838 For more information see the discussion about encoding in the <a href="git-log.html">git-log(1)</a>
839 manual page.</p>
840 </dd>
841 <dt class="hdlist1">--name-status</dt>
842 <dd>
843 <p>Show only the name(s) and status of each changed file. See the description
844 of the <code>--diff-filter</code> option on what the status letters mean.
845 Just like <code>--name-only</code> the file names are often encoded in UTF-8.</p>
846 </dd>
847 <dt class="hdlist1">--submodule[=&lt;format&gt;]</dt>
848 <dd>
849 <p>Specify how differences in submodules are shown. When specifying
850 <code>--submodule=short</code> the <em>short</em> format is used. This format just
851 shows the names of the commits at the beginning and end of the range.
852 When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
853 format is used. This format lists the commits in the range like
854 <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
855 is specified, the <em>diff</em> format is used. This format shows an
856 inline diff of the changes in the submodule contents between the
857 commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
858 if the config option is unset.</p>
859 </dd>
860 <dt class="hdlist1">--color[=&lt;when&gt;]</dt>
861 <dd>
862 <p>Show colored diff.
863 <code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
864 <em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.
865 It can be changed by the <code>color.ui</code> and <code>color.diff</code>
866 configuration settings.</p>
867 </dd>
868 <dt class="hdlist1">--no-color</dt>
869 <dd>
870 <p>Turn off colored diff.
871 This can be used to override configuration settings.
872 It is the same as <code>--color=never</code>.</p>
873 </dd>
874 <dt class="hdlist1">--color-moved[=&lt;mode&gt;]</dt>
875 <dd>
876 <p>Moved lines of code are colored differently.
877 It can be changed by the <code>diff.colorMoved</code> configuration setting.
878 The &lt;mode&gt; defaults to <em>no</em> if the option is not given
879 and to <em>zebra</em> if the option with no mode is given.
880 The mode must be one of:</p>
881 <div class="openblock">
882 <div class="content">
883 <div class="dlist">
884 <dl>
885 <dt class="hdlist1">no</dt>
886 <dd>
887 <p>Moved lines are not highlighted.</p>
888 </dd>
889 <dt class="hdlist1">default</dt>
890 <dd>
891 <p>Is a synonym for <code>zebra</code>. This may change to a more sensible mode
892 in the future.</p>
893 </dd>
894 <dt class="hdlist1">plain</dt>
895 <dd>
896 <p>Any line that is added in one location and was removed
897 in another location will be colored with <em>color.diff.newMoved</em>.
898 Similarly <em>color.diff.oldMoved</em> will be used for removed lines
899 that are added somewhere else in the diff. This mode picks up any
900 moved line, but it is not very useful in a review to determine
901 if a block of code was moved without permutation.</p>
902 </dd>
903 <dt class="hdlist1">blocks</dt>
904 <dd>
905 <p>Blocks of moved text of at least 20 alphanumeric characters
906 are detected greedily. The detected blocks are
907 painted using either the <em>color.diff.{old,new}Moved</em> color.
908 Adjacent blocks cannot be told apart.</p>
909 </dd>
910 <dt class="hdlist1">zebra</dt>
911 <dd>
912 <p>Blocks of moved text are detected as in <em>blocks</em> mode. The blocks
913 are painted using either the <em>color.diff.{old,new}Moved</em> color or
914 <em>color.diff.{old,new}MovedAlternative</em>. The change between
915 the two colors indicates that a new block was detected.</p>
916 </dd>
917 <dt class="hdlist1">dimmed-zebra</dt>
918 <dd>
919 <p>Similar to <em>zebra</em>, but additional dimming of uninteresting parts
920 of moved code is performed. The bordering lines of two adjacent
921 blocks are considered interesting, the rest is uninteresting.
922 <code>dimmed_zebra</code> is a deprecated synonym.</p>
923 </dd>
924 </dl>
925 </div>
926 </div>
927 </div>
928 </dd>
929 <dt class="hdlist1">--no-color-moved</dt>
930 <dd>
931 <p>Turn off move detection. This can be used to override configuration
932 settings. It is the same as <code>--color-moved=no</code>.</p>
933 </dd>
934 <dt class="hdlist1">--color-moved-ws=&lt;modes&gt;</dt>
935 <dd>
936 <p>This configures how whitespace is ignored when performing the
937 move detection for <code>--color-moved</code>.
938 It can be set by the <code>diff.colorMovedWS</code> configuration setting.
939 These modes can be given as a comma separated list:</p>
940 <div class="openblock">
941 <div class="content">
942 <div class="dlist">
943 <dl>
944 <dt class="hdlist1">no</dt>
945 <dd>
946 <p>Do not ignore whitespace when performing move detection.</p>
947 </dd>
948 <dt class="hdlist1">ignore-space-at-eol</dt>
949 <dd>
950 <p>Ignore changes in whitespace at EOL.</p>
951 </dd>
952 <dt class="hdlist1">ignore-space-change</dt>
953 <dd>
954 <p>Ignore changes in amount of whitespace. This ignores whitespace
955 at line end, and considers all other sequences of one or
956 more whitespace characters to be equivalent.</p>
957 </dd>
958 <dt class="hdlist1">ignore-all-space</dt>
959 <dd>
960 <p>Ignore whitespace when comparing lines. This ignores differences
961 even if one line has whitespace where the other line has none.</p>
962 </dd>
963 <dt class="hdlist1">allow-indentation-change</dt>
964 <dd>
965 <p>Initially ignore any whitespace in the move detection, then
966 group the moved code blocks only into a block if the change in
967 whitespace is the same per line. This is incompatible with the
968 other modes.</p>
969 </dd>
970 </dl>
971 </div>
972 </div>
973 </div>
974 </dd>
975 <dt class="hdlist1">--no-color-moved-ws</dt>
976 <dd>
977 <p>Do not ignore whitespace when performing move detection. This can be
978 used to override configuration settings. It is the same as
979 <code>--color-moved-ws=no</code>.</p>
980 </dd>
981 <dt class="hdlist1">--word-diff[=&lt;mode&gt;]</dt>
982 <dd>
983 <p>Show a word diff, using the &lt;mode&gt; to delimit changed words.
984 By default, words are delimited by whitespace; see
985 <code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
986 must be one of:</p>
987 <div class="openblock">
988 <div class="content">
989 <div class="dlist">
990 <dl>
991 <dt class="hdlist1">color</dt>
992 <dd>
993 <p>Highlight changed words using only colors. Implies <code>--color</code>.</p>
994 </dd>
995 <dt class="hdlist1">plain</dt>
996 <dd>
997 <p>Show words as [<code>-removed-</code>] and {+added+}. Makes no
998 attempts to escape the delimiters if they appear in the input,
999 so the output may be ambiguous.</p>
1000 </dd>
1001 <dt class="hdlist1">porcelain</dt>
1002 <dd>
1003 <p>Use a special line-based format intended for script
1004 consumption. Added/removed/unchanged runs are printed in the
1005 usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
1006 character at the beginning of the line and extending to the
1007 end of the line. Newlines in the input are represented by a
1008 tilde <code>~</code> on a line of its own.</p>
1009 </dd>
1010 <dt class="hdlist1">none</dt>
1011 <dd>
1012 <p>Disable word diff again.</p>
1013 </dd>
1014 </dl>
1015 </div>
1016 </div>
1017 </div>
1018 <div class="paragraph">
1019 <p>Note that despite the name of the first mode, color is used to
1020 highlight the changed parts in all modes if enabled.</p>
1021 </div>
1022 </dd>
1023 <dt class="hdlist1">--word-diff-regex=&lt;regex&gt;</dt>
1024 <dd>
1025 <p>Use &lt;regex&gt; to decide what a word is, instead of considering
1026 runs of non-whitespace to be a word. Also implies
1027 <code>--word-diff</code> unless it was already enabled.</p>
1028 <div class="paragraph">
1029 <p>Every non-overlapping match of the
1030 &lt;regex&gt; is considered a word. Anything between these matches is
1031 considered whitespace and ignored(!) for the purposes of finding
1032 differences. You may want to append |[<code>^</code>[<code>:space:</code>]] to your regular
1033 expression to make sure that it matches all non-whitespace characters.
1034 A match that contains a newline is silently truncated(!) at the
1035 newline.</p>
1036 </div>
1037 <div class="paragraph">
1038 <p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1039 and, correspondingly, show differences character by character.</p>
1040 </div>
1041 <div class="paragraph">
1042 <p>The regex can also be set via a diff driver or configuration option, see
1043 <a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
1044 overrides any diff driver or configuration setting. Diff drivers
1045 override configuration settings.</p>
1046 </div>
1047 </dd>
1048 <dt class="hdlist1">--color-words[=&lt;regex&gt;]</dt>
1049 <dd>
1050 <p>Equivalent to <code>--word-diff=color</code> plus (if a regex was
1051 specified) <code>--word-diff-regex=</code><em>&lt;regex&gt;</em>.</p>
1052 </dd>
1053 <dt class="hdlist1">--no-renames</dt>
1054 <dd>
1055 <p>Turn off rename detection, even when the configuration
1056 file gives the default to do so.</p>
1057 </dd>
1058 <dt class="hdlist1">--[no-]rename-empty</dt>
1059 <dd>
1060 <p>Whether to use empty blobs as rename source.</p>
1061 </dd>
1062 <dt class="hdlist1">--check</dt>
1063 <dd>
1064 <p>Warn if changes introduce conflict markers or whitespace errors.
1065 What are considered whitespace errors is controlled by <code>core.whitespace</code>
1066 configuration. By default, trailing whitespaces (including
1067 lines that consist solely of whitespaces) and a space character
1068 that is immediately followed by a tab character inside the
1069 initial indent of the line are considered whitespace errors.
1070 Exits with non-zero status if problems are found. Not compatible
1071 with --exit-code.</p>
1072 </dd>
1073 <dt class="hdlist1">--ws-error-highlight=&lt;kind&gt;</dt>
1074 <dd>
1075 <p>Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
1076 lines of the diff. Multiple values are separated by comma,
1077 <code>none</code> resets previous values, <code>default</code> reset the list to
1078 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
1079 this option is not given, and the configuration variable
1080 <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
1081 <code>new</code> lines are highlighted. The whitespace errors are colored
1082 with <code>color.diff.whitespace</code>.</p>
1083 </dd>
1084 <dt class="hdlist1">--full-index</dt>
1085 <dd>
1086 <p>Instead of the first handful of characters, show the full
1087 pre- and post-image blob object names on the "index"
1088 line when generating patch format output.</p>
1089 </dd>
1090 <dt class="hdlist1">--binary</dt>
1091 <dd>
1092 <p>In addition to <code>--full-index</code>, output a binary diff that
1093 can be applied with <code>git-apply</code>.
1094 Implies <code>--patch</code>.</p>
1095 </dd>
1096 <dt class="hdlist1">--abbrev[=&lt;n&gt;]</dt>
1097 <dd>
1098 <p>Instead of showing the full 40-byte hexadecimal object
1099 name in diff-raw format output and diff-tree header
1100 lines, show the shortest prefix that is at least <em>&lt;n&gt;</em>
1101 hexdigits long that uniquely refers the object.
1102 In diff-patch output format, <code>--full-index</code> takes higher
1103 precedence, i.e. if <code>--full-index</code> is specified, full blob
1104 names will be shown regardless of <code>--abbrev</code>.
1105 Non default number of digits can be specified with <code>--abbrev=</code><em>&lt;n&gt;</em>.</p>
1106 </dd>
1107 <dt class="hdlist1">-B[&lt;n&gt;][/&lt;m&gt;]</dt>
1108 <dt class="hdlist1">--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]</dt>
1109 <dd>
1110 <p>Break complete rewrite changes into pairs of delete and
1111 create. This serves two purposes:</p>
1112 <div class="paragraph">
1113 <p>It affects the way a change that amounts to a total rewrite of a file
1114 not as a series of deletion and insertion mixed together with a very
1115 few lines that happen to match textually as the context, but as a
1116 single deletion of everything old followed by a single insertion of
1117 everything new, and the number <code>m</code> controls this aspect of the -B
1118 option (defaults to 60%). <code>-B/70</code>% specifies that less than 30% of the
1119 original should remain in the result for Git to consider it a total
1120 rewrite (i.e. otherwise the resulting patch will be a series of
1121 deletion and insertion mixed together with context lines).</p>
1122 </div>
1123 <div class="paragraph">
1124 <p>When used with -M, a totally-rewritten file is also considered as the
1125 source of a rename (usually -M only considers a file that disappeared
1126 as the source of a rename), and the number <code>n</code> controls this aspect of
1127 the -B option (defaults to 50%). <code>-B20</code>% specifies that a change with
1128 addition and deletion compared to 20% or more of the file&#8217;s size are
1129 eligible for being picked up as a possible source of a rename to
1130 another file.</p>
1131 </div>
1132 </dd>
1133 <dt class="hdlist1">-M[&lt;n&gt;]</dt>
1134 <dt class="hdlist1">--find-renames[=&lt;n&gt;]</dt>
1135 <dd>
1136 <p>Detect renames.
1137 If <code>n</code> is specified, it is a threshold on the similarity
1138 index (i.e. amount of addition/deletions compared to the
1139 file&#8217;s size). For example, <code>-M90</code>% means Git should consider a
1140 delete/add pair to be a rename if more than 90% of the file
1141 hasn&#8217;t changed. Without a % sign, the number is to be read as
1142 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
1143 0.5, and is thus the same as <code>-M50</code>%. Similarly, <code>-M05</code> is
1144 the same as <code>-M5</code>%. To limit detection to exact renames, use
1145 <code>-M100</code>%. The default similarity index is 50%.</p>
1146 </dd>
1147 <dt class="hdlist1">-C[&lt;n&gt;]</dt>
1148 <dt class="hdlist1">--find-copies[=&lt;n&gt;]</dt>
1149 <dd>
1150 <p>Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1151 If <code>n</code> is specified, it has the same meaning as for <code>-M</code><em>&lt;n&gt;</em>.</p>
1152 </dd>
1153 <dt class="hdlist1">--find-copies-harder</dt>
1154 <dd>
1155 <p>For performance reasons, by default, <code>-C</code> option finds copies only
1156 if the original file of the copy was modified in the same
1157 changeset. This flag makes the command
1158 inspect unmodified files as candidates for the source of
1159 copy. This is a very expensive operation for large
1160 projects, so use it with caution. Giving more than one
1161 <code>-C</code> option has the same effect.</p>
1162 </dd>
1163 <dt class="hdlist1">-D</dt>
1164 <dt class="hdlist1">--irreversible-delete</dt>
1165 <dd>
1166 <p>Omit the preimage for deletes, i.e. print only the header but not
1167 the diff between the preimage and <code>/dev/null</code>. The resulting patch
1168 is not meant to be applied with <code>patch</code> or <code>git</code> <code>apply</code>; this is
1169 solely for people who want to just concentrate on reviewing the
1170 text after the change. In addition, the output obviously lacks
1171 enough information to apply such a patch in reverse, even manually,
1172 hence the name of the option.</p>
1173 <div class="paragraph">
1174 <p>When used together with <code>-B</code>, omit also the preimage in the deletion part
1175 of a delete/create pair.</p>
1176 </div>
1177 </dd>
1178 <dt class="hdlist1">-l&lt;num&gt;</dt>
1179 <dd>
1180 <p>The <code>-M</code> and <code>-C</code> options involve some preliminary steps that
1181 can detect subsets of renames/copies cheaply, followed by an
1182 exhaustive fallback portion that compares all remaining
1183 unpaired destinations to all relevant sources. (For renames,
1184 only remaining unpaired sources are relevant; for copies, all
1185 original sources are relevant.) For N sources and
1186 destinations, this exhaustive check is O(N^2). This option
1187 prevents the exhaustive portion of rename/copy detection from
1188 running if the number of source/destination files involved
1189 exceeds the specified number. Defaults to diff.renameLimit.
1190 Note that a value of 0 is treated as unlimited.</p>
1191 </dd>
1192 <dt class="hdlist1">--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;&#8203;[*]]</dt>
1193 <dd>
1194 <p>Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1195 Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1196 type (i.e. regular file, symlink, submodule, &#8230;&#8203;) changed (<code>T</code>),
1197 are Unmerged (<code>U</code>), are
1198 Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
1199 Any combination of the filter characters (including none) can be used.
1200 When * (All-or-none) is added to the combination, all
1201 paths are selected if there is any file that matches
1202 other criteria in the comparison; if there is no file
1203 that matches other criteria, nothing is selected.</p>
1204 <div class="paragraph">
1205 <p>Also, these upper-case letters can be downcased to exclude. E.g.
1206 <code>--diff-filter=ad</code> excludes added and deleted paths.</p>
1207 </div>
1208 <div class="paragraph">
1209 <p>Note that not all diffs can feature all types. For instance, copied and
1210 renamed entries cannot appear if detection for those types is disabled.</p>
1211 </div>
1212 </dd>
1213 <dt class="hdlist1">-S&lt;string&gt;</dt>
1214 <dd>
1215 <p>Look for differences that change the number of occurrences of
1216 the specified string (i.e. addition/deletion) in a file.
1217 Intended for the scripter&#8217;s use.</p>
1218 <div class="paragraph">
1219 <p>It is useful when you&#8217;re looking for an exact block of code (like a
1220 struct), and want to know the history of that block since it first
1221 came into being: use the feature iteratively to feed the interesting
1222 block in the preimage back into <code>-S</code>, and keep going until you get the
1223 very first version of the block.</p>
1224 </div>
1225 <div class="paragraph">
1226 <p>Binary files are searched as well.</p>
1227 </div>
1228 </dd>
1229 <dt class="hdlist1">-G&lt;regex&gt;</dt>
1230 <dd>
1231 <p>Look for differences whose patch text contains added/removed
1232 lines that match &lt;regex&gt;.</p>
1233 <div class="paragraph">
1234 <p>To illustrate the difference between <code>-S</code><em>&lt;regex&gt;</em> <code>--pickaxe-regex</code> and
1235 <code>-G</code><em>&lt;regex&gt;</em>, consider a commit with the following diff in the same
1236 file:</p>
1237 </div>
1238 <div class="listingblock">
1239 <div class="content">
1240 <pre>+ return frotz(nitfol, two-&gt;ptr, 1, 0);
1242 - hit = frotz(nitfol, mf2.ptr, 1, 0);</pre>
1243 </div>
1244 </div>
1245 <div class="paragraph">
1246 <p>While <code>git</code> <code>log</code> <code>-G</code>"frotz\(<code>nitfol</code>" will show this commit, <code>git</code> <code>log</code>
1247 <code>-S</code>"frotz\(<code>nitfol</code>" <code>--pickaxe-regex</code> will not (because the number of
1248 occurrences of that string did not change).</p>
1249 </div>
1250 <div class="paragraph">
1251 <p>Unless <code>--text</code> is supplied patches of binary files without a textconv
1252 filter will be ignored.</p>
1253 </div>
1254 <div class="paragraph">
1255 <p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1256 information.</p>
1257 </div>
1258 </dd>
1259 <dt class="hdlist1">--find-object=&lt;object-id&gt;</dt>
1260 <dd>
1261 <p>Look for differences that change the number of occurrences of
1262 the specified object. Similar to <code>-S</code>, just the argument is different
1263 in that it doesn&#8217;t search for a specific string but for a specific
1264 object id.</p>
1265 <div class="paragraph">
1266 <p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
1267 <code>git-log</code> to also find trees.</p>
1268 </div>
1269 </dd>
1270 <dt class="hdlist1">--pickaxe-all</dt>
1271 <dd>
1272 <p>When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
1273 changeset, not just the files that contain the change
1274 in &lt;string&gt;.</p>
1275 </dd>
1276 <dt class="hdlist1">--pickaxe-regex</dt>
1277 <dd>
1278 <p>Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
1279 expression to match.</p>
1280 </dd>
1281 <dt class="hdlist1">-O&lt;orderfile&gt;</dt>
1282 <dd>
1283 <p>Control the order in which files appear in the output.
1284 This overrides the <code>diff.orderFile</code> configuration variable
1285 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
1286 use <code>-O/dev/null</code>.</p>
1287 <div class="paragraph">
1288 <p>The output order is determined by the order of glob patterns in
1289 &lt;orderfile&gt;.
1290 All files with pathnames that match the first pattern are output
1291 first, all files with pathnames that match the second pattern (but not
1292 the first) are output next, and so on.
1293 All files with pathnames that do not match any pattern are output
1294 last, as if there was an implicit match-all pattern at the end of the
1295 file.
1296 If multiple pathnames have the same rank (they match the same pattern
1297 but no earlier patterns), their output order relative to each other is
1298 the normal order.</p>
1299 </div>
1300 <div class="paragraph">
1301 <p>&lt;orderfile&gt; is parsed as follows:</p>
1302 </div>
1303 <div class="openblock">
1304 <div class="content">
1305 <div class="ulist">
1306 <ul>
1307 <li>
1308 <p>Blank lines are ignored, so they can be used as separators for
1309 readability.</p>
1310 </li>
1311 <li>
1312 <p>Lines starting with a hash ("#") are ignored, so they can be used
1313 for comments. Add a backslash ("\") to the beginning of the
1314 pattern if it starts with a hash.</p>
1315 </li>
1316 <li>
1317 <p>Each other line contains a single pattern.</p>
1318 </li>
1319 </ul>
1320 </div>
1321 </div>
1322 </div>
1323 <div class="paragraph">
1324 <p>Patterns have the same syntax and semantics as patterns used for
1325 fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
1326 matches a pattern if removing any number of the final pathname
1327 components matches the pattern. For example, the pattern "<code>foo</code>*bar"
1328 matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p>
1329 </div>
1330 </dd>
1331 <dt class="hdlist1">--skip-to=&lt;file&gt;</dt>
1332 <dt class="hdlist1">--rotate-to=&lt;file&gt;</dt>
1333 <dd>
1334 <p>Discard the files before the named &lt;file&gt; from the output
1335 (i.e. <em>skip to</em>), or move them to the end of the output
1336 (i.e. <em>rotate to</em>). These options were invented primarily for the use
1337 of the <code>git</code> <code>difftool</code> command, and may not be very useful
1338 otherwise.</p>
1339 </dd>
1340 <dt class="hdlist1">-R</dt>
1341 <dd>
1342 <p>Swap two inputs; that is, show differences from index or
1343 on-disk file to tree contents.</p>
1344 </dd>
1345 <dt class="hdlist1">--relative[=&lt;path&gt;]</dt>
1346 <dt class="hdlist1">--no-relative</dt>
1347 <dd>
1348 <p>When run from a subdirectory of the project, it can be
1349 told to exclude changes outside the directory and show
1350 pathnames relative to it with this option. When you are
1351 not in a subdirectory (e.g. in a bare repository), you
1352 can name which subdirectory to make the output relative
1353 to by giving a &lt;path&gt; as an argument.
1354 <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
1355 option and previous <code>--relative</code>.</p>
1356 </dd>
1357 <dt class="hdlist1">-a</dt>
1358 <dt class="hdlist1">--text</dt>
1359 <dd>
1360 <p>Treat all files as text.</p>
1361 </dd>
1362 <dt class="hdlist1">--ignore-cr-at-eol</dt>
1363 <dd>
1364 <p>Ignore carriage-return at the end of line when doing a comparison.</p>
1365 </dd>
1366 <dt class="hdlist1">--ignore-space-at-eol</dt>
1367 <dd>
1368 <p>Ignore changes in whitespace at EOL.</p>
1369 </dd>
1370 <dt class="hdlist1">-b</dt>
1371 <dt class="hdlist1">--ignore-space-change</dt>
1372 <dd>
1373 <p>Ignore changes in amount of whitespace. This ignores whitespace
1374 at line end, and considers all other sequences of one or
1375 more whitespace characters to be equivalent.</p>
1376 </dd>
1377 <dt class="hdlist1">-w</dt>
1378 <dt class="hdlist1">--ignore-all-space</dt>
1379 <dd>
1380 <p>Ignore whitespace when comparing lines. This ignores
1381 differences even if one line has whitespace where the other
1382 line has none.</p>
1383 </dd>
1384 <dt class="hdlist1">--ignore-blank-lines</dt>
1385 <dd>
1386 <p>Ignore changes whose lines are all blank.</p>
1387 </dd>
1388 <dt class="hdlist1">-I&lt;regex&gt;</dt>
1389 <dt class="hdlist1">--ignore-matching-lines=&lt;regex&gt;</dt>
1390 <dd>
1391 <p>Ignore changes whose all lines match &lt;regex&gt;. This option may
1392 be specified more than once.</p>
1393 </dd>
1394 <dt class="hdlist1">--inter-hunk-context=&lt;lines&gt;</dt>
1395 <dd>
1396 <p>Show the context between diff hunks, up to the specified number
1397 of lines, thereby fusing hunks that are close to each other.
1398 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
1399 is unset.</p>
1400 </dd>
1401 <dt class="hdlist1">-W</dt>
1402 <dt class="hdlist1">--function-context</dt>
1403 <dd>
1404 <p>Show whole function as context lines for each change.
1405 The function names are determined in the same way as
1406 <code>git</code> <code>diff</code> works out patch hunk headers (see <em>Defining a
1407 custom hunk-header</em> in <a href="gitattributes.html">gitattributes(5)</a>).</p>
1408 </dd>
1409 <dt class="hdlist1">--exit-code</dt>
1410 <dd>
1411 <p>Make the program exit with codes similar to diff(1).
1412 That is, it exits with 1 if there were differences and
1413 0 means no differences.</p>
1414 </dd>
1415 <dt class="hdlist1">--quiet</dt>
1416 <dd>
1417 <p>Disable all output of the program. Implies <code>--exit-code</code>.
1418 Disables execution of external diff helpers whose exit code
1419 is not trusted, i.e. their respective configuration option
1420 <code>diff.trustExitCode</code> or <code>diff.</code><em>&lt;driver&gt;</em><code>.trustExitCode</code> or
1421 environment variable <code>GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE</code> is
1422 false.</p>
1423 </dd>
1424 <dt class="hdlist1">--ext-diff</dt>
1425 <dd>
1426 <p>Allow an external diff helper to be executed. If you set an
1427 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1428 to use this option with <a href="git-log.html">git-log(1)</a> and friends.</p>
1429 </dd>
1430 <dt class="hdlist1">--no-ext-diff</dt>
1431 <dd>
1432 <p>Disallow external diff drivers.</p>
1433 </dd>
1434 <dt class="hdlist1">--textconv</dt>
1435 <dt class="hdlist1">--no-textconv</dt>
1436 <dd>
1437 <p>Allow (or disallow) external text conversion filters to be run
1438 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
1439 details. Because textconv filters are typically a one-way
1440 conversion, the resulting diff is suitable for human
1441 consumption, but cannot be applied. For this reason, textconv
1442 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1443 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
1444 diff plumbing commands.</p>
1445 </dd>
1446 <dt class="hdlist1">--ignore-submodules[=&lt;when&gt;]</dt>
1447 <dd>
1448 <p>Ignore changes to submodules in the diff generation. &lt;when&gt; can be
1449 either "none", "untracked", "dirty" or "all", which is the default.
1450 Using "none" will consider the submodule modified when it either contains
1451 untracked or modified files or its HEAD differs from the commit recorded
1452 in the superproject and can be used to override any settings of the
1453 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
1454 "untracked" is used submodules are not considered dirty when they only
1455 contain untracked content (but they are still scanned for modified
1456 content). Using "dirty" ignores all changes to the work tree of submodules,
1457 only changes to the commits stored in the superproject are shown (this was
1458 the behavior until 1.7.0). Using "all" hides all changes to submodules.</p>
1459 </dd>
1460 <dt class="hdlist1">--src-prefix=&lt;prefix&gt;</dt>
1461 <dd>
1462 <p>Show the given source prefix instead of "a/".</p>
1463 </dd>
1464 <dt class="hdlist1">--dst-prefix=&lt;prefix&gt;</dt>
1465 <dd>
1466 <p>Show the given destination prefix instead of "b/".</p>
1467 </dd>
1468 <dt class="hdlist1">--no-prefix</dt>
1469 <dd>
1470 <p>Do not show any source or destination prefix.</p>
1471 </dd>
1472 <dt class="hdlist1">--default-prefix</dt>
1473 <dd>
1474 <p>Use the default source and destination prefixes ("a/" and "b/").
1475 This overrides configuration variables such as <code>diff.noprefix</code>,
1476 <code>diff.srcPrefix</code>, <code>diff.dstPrefix</code>, and <code>diff.mnemonicPrefix</code>
1477 (see <code>git-config</code>(1)).</p>
1478 </dd>
1479 <dt class="hdlist1">--line-prefix=&lt;prefix&gt;</dt>
1480 <dd>
1481 <p>Prepend an additional prefix to every line of output.</p>
1482 </dd>
1483 <dt class="hdlist1">--ita-invisible-in-index</dt>
1484 <dd>
1485 <p>By default entries added by "git add -N" appear as an existing
1486 empty file in "git diff" and a new file in "git diff --cached".
1487 This option makes the entry appear as a new file in "git diff"
1488 and non-existent in "git diff --cached". This option could be
1489 reverted with <code>--ita-visible-in-index</code>. Both options are
1490 experimental and could be removed in future.</p>
1491 </dd>
1492 </dl>
1493 </div>
1494 <div class="paragraph">
1495 <p>For more detailed explanation on these common options, see also
1496 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p>
1497 </div>
1498 <div class="dlist">
1499 <dl>
1500 <dt class="hdlist1">-1 --base</dt>
1501 <dt class="hdlist1">-2 --ours</dt>
1502 <dt class="hdlist1">-3 --theirs</dt>
1503 <dd>
1504 <p>Compare the working tree with the "base" version (stage #1),
1505 "our branch" (stage #2) or "their branch" (stage #3). The
1506 index contains these stages only for unmerged entries i.e.
1507 while resolving conflicts. See <a href="git-read-tree.html">git-read-tree(1)</a>
1508 section "3-Way Merge" for detailed information.</p>
1509 </dd>
1510 <dt class="hdlist1">-0</dt>
1511 <dd>
1512 <p>Omit diff output for unmerged entries and just show
1513 "Unmerged". Can be used only when comparing the working tree
1514 with the index.</p>
1515 </dd>
1516 <dt class="hdlist1">&lt;path&gt;&#8230;&#8203;</dt>
1517 <dd>
1518 <p>The &lt;paths&gt; parameters, when given, are used to limit
1519 the diff to the named paths (you can give directory
1520 names and get diff for all files under them).</p>
1521 </dd>
1522 </dl>
1523 </div>
1524 </div>
1525 </div>
1526 <div class="sect1">
1527 <h2 id="_raw_output_format">Raw output format</h2>
1528 <div class="sectionbody">
1529 <div class="paragraph">
1530 <p>The raw output format from "git-diff-index", "git-diff-tree",
1531 "git-diff-files" and "git diff --raw" are very similar.</p>
1532 </div>
1533 <div class="paragraph">
1534 <p>These commands all compare two sets of things; what is
1535 compared differs:</p>
1536 </div>
1537 <div class="dlist">
1538 <dl>
1539 <dt class="hdlist1">git-diff-index &lt;tree-ish&gt;</dt>
1540 <dd>
1541 <p>compares the &lt;tree-ish&gt; and the files on the filesystem.</p>
1542 </dd>
1543 <dt class="hdlist1">git-diff-index --cached &lt;tree-ish&gt;</dt>
1544 <dd>
1545 <p>compares the &lt;tree-ish&gt; and the index.</p>
1546 </dd>
1547 <dt class="hdlist1">git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;&#8203;]</dt>
1548 <dd>
1549 <p>compares the trees named by the two arguments.</p>
1550 </dd>
1551 <dt class="hdlist1">git-diff-files [&lt;pattern&gt;&#8230;&#8203;]</dt>
1552 <dd>
1553 <p>compares the index and the files on the filesystem.</p>
1554 </dd>
1555 </dl>
1556 </div>
1557 <div class="paragraph">
1558 <p>The "git-diff-tree" command begins its output by printing the hash of
1559 what is being compared. After that, all the commands print one output
1560 line per changed file.</p>
1561 </div>
1562 <div class="paragraph">
1563 <p>An output line is formatted this way:</p>
1564 </div>
1565 <div class="listingblock">
1566 <div class="content">
1567 <pre>in-place edit :100644 100644 bcd1234 0123456 M file0
1568 copy-edit :100644 100644 abcd123 1234567 C68 file1 file2
1569 rename-edit :100644 100644 abcd123 1234567 R86 file1 file3
1570 create :000000 100644 0000000 1234567 A file4
1571 delete :100644 000000 1234567 0000000 D file5
1572 unmerged :000000 000000 0000000 0000000 U file6</pre>
1573 </div>
1574 </div>
1575 <div class="paragraph">
1576 <p>That is, from the left to the right:</p>
1577 </div>
1578 <div class="olist arabic">
1579 <ol class="arabic">
1580 <li>
1581 <p>a colon.</p>
1582 </li>
1583 <li>
1584 <p>mode for "src"; 000000 if creation or unmerged.</p>
1585 </li>
1586 <li>
1587 <p>a space.</p>
1588 </li>
1589 <li>
1590 <p>mode for "dst"; 000000 if deletion or unmerged.</p>
1591 </li>
1592 <li>
1593 <p>a space.</p>
1594 </li>
1595 <li>
1596 <p>sha1 for "src"; 0{40} if creation or unmerged.</p>
1597 </li>
1598 <li>
1599 <p>a space.</p>
1600 </li>
1601 <li>
1602 <p>sha1 for "dst"; 0{40} if deletion, unmerged or "work tree out of sync with the index".</p>
1603 </li>
1604 <li>
1605 <p>a space.</p>
1606 </li>
1607 <li>
1608 <p>status, followed by optional "score" number.</p>
1609 </li>
1610 <li>
1611 <p>a tab or a NUL when <code>-z</code> option is used.</p>
1612 </li>
1613 <li>
1614 <p>path for "src"</p>
1615 </li>
1616 <li>
1617 <p>a tab or a NUL when <code>-z</code> option is used; only exists for C or R.</p>
1618 </li>
1619 <li>
1620 <p>path for "dst"; only exists for C or R.</p>
1621 </li>
1622 <li>
1623 <p>an LF or a NUL when <code>-z</code> option is used, to terminate the record.</p>
1624 </li>
1625 </ol>
1626 </div>
1627 <div class="paragraph">
1628 <p>Possible status letters are:</p>
1629 </div>
1630 <div class="ulist">
1631 <ul>
1632 <li>
1633 <p>A: addition of a file</p>
1634 </li>
1635 <li>
1636 <p>C: copy of a file into a new one</p>
1637 </li>
1638 <li>
1639 <p>D: deletion of a file</p>
1640 </li>
1641 <li>
1642 <p>M: modification of the contents or mode of a file</p>
1643 </li>
1644 <li>
1645 <p>R: renaming of a file</p>
1646 </li>
1647 <li>
1648 <p>T: change in the type of the file (regular file, symbolic link or submodule)</p>
1649 </li>
1650 <li>
1651 <p>U: file is unmerged (you must complete the merge before it can
1652 be committed)</p>
1653 </li>
1654 <li>
1655 <p>X: "unknown" change type (most probably a bug, please report it)</p>
1656 </li>
1657 </ul>
1658 </div>
1659 <div class="paragraph">
1660 <p>Status letters C and R are always followed by a score (denoting the
1661 percentage of similarity between the source and target of the move or
1662 copy). Status letter M may be followed by a score (denoting the
1663 percentage of dissimilarity) for file rewrites.</p>
1664 </div>
1665 <div class="paragraph">
1666 <p>The sha1 for "dst" is shown as all 0&#8217;s if a file on the filesystem
1667 is out of sync with the index.</p>
1668 </div>
1669 <div class="paragraph">
1670 <p>Example:</p>
1671 </div>
1672 <div class="listingblock">
1673 <div class="content">
1674 <pre>:100644 100644 5be4a4a 0000000 M file.c</pre>
1675 </div>
1676 </div>
1677 <div class="paragraph">
1678 <p>Without the <code>-z</code> option, pathnames with "unusual" characters are
1679 quoted as explained for the configuration variable <code>core.quotePath</code>
1680 (see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output
1681 verbatim and the line is terminated by a NUL byte.</p>
1682 </div>
1683 </div>
1684 </div>
1685 <div class="sect1">
1686 <h2 id="_diff_format_for_merges">diff format for merges</h2>
1687 <div class="sectionbody">
1688 <div class="paragraph">
1689 <p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
1690 can take <code>-c</code> or <code>--cc</code> option
1691 to generate diff output also for merge commits. The output differs
1692 from the format described above in the following way:</p>
1693 </div>
1694 <div class="olist arabic">
1695 <ol class="arabic">
1696 <li>
1697 <p>there is a colon for each parent</p>
1698 </li>
1699 <li>
1700 <p>there are more "src" modes and "src" sha1</p>
1701 </li>
1702 <li>
1703 <p>status is concatenated status characters for each parent</p>
1704 </li>
1705 <li>
1706 <p>no optional "score" number</p>
1707 </li>
1708 <li>
1709 <p>tab-separated pathname(s) of the file</p>
1710 </li>
1711 </ol>
1712 </div>
1713 <div class="paragraph">
1714 <p>For <code>-c</code> and <code>--cc</code>, only the destination or final path is shown even
1715 if the file was renamed on any side of history. With
1716 <code>--combined-all-paths</code>, the name of the path in each parent is shown
1717 followed by the name of the path in the merge commit.</p>
1718 </div>
1719 <div class="paragraph">
1720 <p>Examples for <code>-c</code> and <code>--cc</code> without <code>--combined-all-paths</code>:</p>
1721 </div>
1722 <div class="listingblock">
1723 <div class="content">
1724 <pre>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c
1725 ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh
1726 ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR phooey.c</pre>
1727 </div>
1728 </div>
1729 <div class="paragraph">
1730 <p>Examples when <code>--combined-all-paths</code> added to either <code>-c</code> or <code>--cc</code>:</p>
1731 </div>
1732 <div class="listingblock">
1733 <div class="content">
1734 <pre>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c desc.c desc.c
1735 ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM foo.sh bar.sh bar.sh
1736 ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR fooey.c fuey.c phooey.c</pre>
1737 </div>
1738 </div>
1739 <div class="paragraph">
1740 <p>Note that <em>combined diff</em> lists only files which were modified from
1741 all parents.</p>
1742 </div>
1743 </div>
1744 </div>
1745 <div class="sect1">
1746 <h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
1747 <div class="sectionbody">
1748 <div class="paragraph">
1749 <p>Running
1750 <a href="git-diff.html">git-diff(1)</a>,
1751 <a href="git-log.html">git-log(1)</a>,
1752 <a href="git-show.html">git-show(1)</a>,
1753 <a href="git-diff-index.html">git-diff-index(1)</a>,
1754 <a href="git-diff-tree.html">git-diff-tree(1)</a>, or
1755 <a href="git-diff-files.html">git-diff-files(1)</a>
1756 with the <code>-p</code> option produces patch text.
1757 You can customize the creation of patch text via the
1758 <code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables
1759 (see <a href="git.html">git(1)</a>), and the <code>diff</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).</p>
1760 </div>
1761 <div class="paragraph">
1762 <p>What the -p option produces is slightly different from the traditional
1763 diff format:</p>
1764 </div>
1765 <div class="olist arabic">
1766 <ol class="arabic">
1767 <li>
1768 <p>It is preceded by a "git diff" header that looks like this:</p>
1769 <div class="literalblock">
1770 <div class="content">
1771 <pre>diff --git a/file1 b/file2</pre>
1772 </div>
1773 </div>
1774 <div class="paragraph">
1775 <p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
1776 involved. Especially, even for a creation or a deletion,
1777 <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p>
1778 </div>
1779 <div class="paragraph">
1780 <p>When a rename/copy is involved, <code>file1</code> and <code>file2</code> show the
1781 name of the source file of the rename/copy and the name of
1782 the file that the rename/copy produces, respectively.</p>
1783 </div>
1784 </li>
1785 <li>
1786 <p>It is followed by one or more extended header lines:</p>
1787 <div class="literalblock">
1788 <div class="content">
1789 <pre>old mode &lt;mode&gt;
1790 new mode &lt;mode&gt;
1791 deleted file mode &lt;mode&gt;
1792 new file mode &lt;mode&gt;
1793 copy from &lt;path&gt;
1794 copy to &lt;path&gt;
1795 rename from &lt;path&gt;
1796 rename to &lt;path&gt;
1797 similarity index &lt;number&gt;
1798 dissimilarity index &lt;number&gt;
1799 index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</pre>
1800 </div>
1801 </div>
1802 <div class="paragraph">
1803 <p>File modes are printed as 6-digit octal numbers including the file type
1804 and file permission bits.</p>
1805 </div>
1806 <div class="paragraph">
1807 <p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p>
1808 </div>
1809 <div class="paragraph">
1810 <p>The similarity index is the percentage of unchanged lines, and
1811 the dissimilarity index is the percentage of changed lines. It
1812 is a rounded down integer, followed by a percent sign. The
1813 similarity index value of 100% is thus reserved for two equal
1814 files, while 100% dissimilarity means that no line from the old
1815 file made it into the new one.</p>
1816 </div>
1817 <div class="paragraph">
1818 <p>The index line includes the blob object names before and after the change.
1819 The &lt;mode&gt; is included if the file mode does not change; otherwise,
1820 separate lines indicate the old and the new mode.</p>
1821 </div>
1822 </li>
1823 <li>
1824 <p>Pathnames with "unusual" characters are quoted as explained for
1825 the configuration variable <code>core.quotePath</code> (see
1826 <a href="git-config.html">git-config(1)</a>).</p>
1827 </li>
1828 <li>
1829 <p>All the <code>file1</code> files in the output refer to files before the
1830 commit, and all the <code>file2</code> files refer to files after the commit.
1831 It is incorrect to apply each change to each file sequentially. For
1832 example, this patch will swap a and b:</p>
1833 <div class="literalblock">
1834 <div class="content">
1835 <pre>diff --git a/a b/b
1836 rename from a
1837 rename to b
1838 diff --git a/b b/a
1839 rename from b
1840 rename to a</pre>
1841 </div>
1842 </div>
1843 </li>
1844 <li>
1845 <p>Hunk headers mention the name of the function to which the hunk
1846 applies. See "Defining a custom hunk-header" in
1847 <a href="gitattributes.html">gitattributes(5)</a> for details of how to tailor this to
1848 specific languages.</p>
1849 </li>
1850 </ol>
1851 </div>
1852 </div>
1853 </div>
1854 <div class="sect1">
1855 <h2 id="_combined_diff_format">Combined diff format</h2>
1856 <div class="sectionbody">
1857 <div class="paragraph">
1858 <p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
1859 produce a <em>combined diff</em> when showing a merge. This is the default
1860 format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
1861 <a href="git-show.html">git-show(1)</a>. Note also that you can give suitable
1862 <code>--diff-merges</code> option to any of these commands to force generation of
1863 diffs in a specific format.</p>
1864 </div>
1865 <div class="paragraph">
1866 <p>A "combined diff" format looks like this:</p>
1867 </div>
1868 <div class="listingblock">
1869 <div class="content">
1870 <pre>diff --combined describe.c
1871 index fabadb8,cc95eb0..4866510
1872 --- a/describe.c
1873 +++ b/describe.c
1874 @@@ -98,20 -98,12 +98,20 @@@
1875 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
1878 - static void describe(char *arg)
1879 -static void describe(struct commit *cmit, int last_one)
1880 ++static void describe(char *arg, int last_one)
1882 + unsigned char sha1[20];
1883 + struct commit *cmit;
1884 struct commit_list *list;
1885 static int initialized = 0;
1886 struct commit_name *n;
1888 + if (get_sha1(arg, sha1) &lt; 0)
1889 + usage(describe_usage);
1890 + cmit = lookup_commit_reference(sha1);
1891 + if (!cmit)
1892 + usage(describe_usage);
1894 if (!initialized) {
1895 initialized = 1;
1896 for_each_ref(get_name);</pre>
1897 </div>
1898 </div>
1899 <div class="olist arabic">
1900 <ol class="arabic">
1901 <li>
1902 <p>It is preceded by a "git diff" header, that looks like
1903 this (when the <code>-c</code> option is used):</p>
1904 <div class="literalblock">
1905 <div class="content">
1906 <pre>diff --combined file</pre>
1907 </div>
1908 </div>
1909 <div class="paragraph">
1910 <p>or like this (when the <code>--cc</code> option is used):</p>
1911 </div>
1912 <div class="literalblock">
1913 <div class="content">
1914 <pre>diff --cc file</pre>
1915 </div>
1916 </div>
1917 </li>
1918 <li>
1919 <p>It is followed by one or more extended header lines
1920 (this example shows a merge with two parents):</p>
1921 <div class="literalblock">
1922 <div class="content">
1923 <pre>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
1924 mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
1925 new file mode &lt;mode&gt;
1926 deleted file mode &lt;mode&gt;,&lt;mode&gt;</pre>
1927 </div>
1928 </div>
1929 <div class="paragraph">
1930 <p>The <code>mode</code> <em>&lt;mode&gt;</em><code>,</code><em>&lt;mode&gt;</em><code>..</code><em>&lt;mode&gt;</em> line appears only if at least one of
1931 the &lt;mode&gt; is different from the rest. Extended headers with
1932 information about detected content movement (renames and
1933 copying detection) are designed to work with the diff of two
1934 &lt;tree-ish&gt; and are not used by combined diff format.</p>
1935 </div>
1936 </li>
1937 <li>
1938 <p>It is followed by a two-line from-file/to-file header:</p>
1939 <div class="literalblock">
1940 <div class="content">
1941 <pre>--- a/file
1942 +++ b/file</pre>
1943 </div>
1944 </div>
1945 <div class="paragraph">
1946 <p>Similar to the two-line header for the traditional <em>unified</em> diff
1947 format, <code>/dev/null</code> is used to signal created or deleted
1948 files.</p>
1949 </div>
1950 <div class="paragraph">
1951 <p>However, if the --combined-all-paths option is provided, instead of a
1952 two-line from-file/to-file, you get an N+1 line from-file/to-file header,
1953 where N is the number of parents in the merge commit:</p>
1954 </div>
1955 <div class="literalblock">
1956 <div class="content">
1957 <pre>--- a/file
1958 --- a/file
1959 --- a/file
1960 +++ b/file</pre>
1961 </div>
1962 </div>
1963 <div class="paragraph">
1964 <p>This extended format can be useful if rename or copy detection is
1965 active, to allow you to see the original name of the file in different
1966 parents.</p>
1967 </div>
1968 </li>
1969 <li>
1970 <p>Chunk header format is modified to prevent people from
1971 accidentally feeding it to <code>patch</code> <code>-p1</code>. Combined diff format
1972 was created for review of merge commit changes, and was not
1973 meant to be applied. The change is similar to the change in the
1974 extended <em>index</em> header:</p>
1975 <div class="literalblock">
1976 <div class="content">
1977 <pre>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</pre>
1978 </div>
1979 </div>
1980 <div class="paragraph">
1981 <p>There are (number of parents + 1) <code>@</code> characters in the chunk
1982 header for combined diff format.</p>
1983 </div>
1984 </li>
1985 </ol>
1986 </div>
1987 <div class="paragraph">
1988 <p>Unlike the traditional <em>unified</em> diff format, which shows two
1989 files A and B with a single column that has <code>-</code> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <code>+</code> (plus&#8201;&#8212;&#8201;missing in A but
1990 added to B), or " " (space&#8201;&#8212;&#8201;unchanged) prefix, this format
1991 compares two or more files file1, file2,&#8230;&#8203; with one file X, and
1992 shows how X differs from each of fileN. One column for each of
1993 fileN is prepended to the output line to note how X&#8217;s line is
1994 different from it.</p>
1995 </div>
1996 <div class="paragraph">
1997 <p>A <code>-</code> character in the column N means that the line appears in
1998 fileN but it does not appear in the result. A <code>+</code> character
1999 in the column N means that the line appears in the result,
2000 and fileN does not have that line (in other words, the line was
2001 added, from the point of view of that parent).</p>
2002 </div>
2003 <div class="paragraph">
2004 <p>In the above example output, the function signature was changed
2005 from both files (hence two <code>-</code> removals from both file1 and
2006 file2, plus <code>++</code> to mean one line that was added does not appear
2007 in either file1 or file2). Also, eight other lines are the same
2008 from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p>
2009 </div>
2010 <div class="paragraph">
2011 <p>When shown by <code>git</code> <code>diff-tree</code> <code>-c</code>, it compares the parents of a
2012 merge commit with the merge result (i.e. file1..fileN are the
2013 parents). When shown by <code>git</code> <code>diff-files</code> <code>-c</code>, it compares the
2014 two unresolved merge parents with the working tree file
2015 (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2016 "their version").</p>
2017 </div>
2018 </div>
2019 </div>
2020 <div class="sect1">
2021 <h2 id="_other_diff_formats">other diff formats</h2>
2022 <div class="sectionbody">
2023 <div class="paragraph">
2024 <p>The <code>--summary</code> option describes newly added, deleted, renamed and
2025 copied files. The <code>--stat</code> option adds diffstat(1) graph to the
2026 output. These options can be combined with other options, such as
2027 <code>-p</code>, and are meant for human consumption.</p>
2028 </div>
2029 <div class="paragraph">
2030 <p>When showing a change that involves a rename or a copy, <code>--stat</code> output
2031 formats the pathnames compactly by combining common prefix and suffix of
2032 the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2033 <code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p>
2034 </div>
2035 <div class="listingblock">
2036 <div class="content">
2037 <pre>arch/{i386 =&gt; x86}/Makefile | 4 +--</pre>
2038 </div>
2039 </div>
2040 <div class="paragraph">
2041 <p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2042 for easier machine consumption. An entry in <code>--numstat</code> output looks
2043 like this:</p>
2044 </div>
2045 <div class="listingblock">
2046 <div class="content">
2047 <pre>1 2 README
2048 3 1 arch/{i386 =&gt; x86}/Makefile</pre>
2049 </div>
2050 </div>
2051 <div class="paragraph">
2052 <p>That is, from left to right:</p>
2053 </div>
2054 <div class="olist arabic">
2055 <ol class="arabic">
2056 <li>
2057 <p>the number of added lines;</p>
2058 </li>
2059 <li>
2060 <p>a tab;</p>
2061 </li>
2062 <li>
2063 <p>the number of deleted lines;</p>
2064 </li>
2065 <li>
2066 <p>a tab;</p>
2067 </li>
2068 <li>
2069 <p>pathname (possibly with rename/copy information);</p>
2070 </li>
2071 <li>
2072 <p>a newline.</p>
2073 </li>
2074 </ol>
2075 </div>
2076 <div class="paragraph">
2077 <p>When <code>-z</code> output option is in effect, the output is formatted this way:</p>
2078 </div>
2079 <div class="listingblock">
2080 <div class="content">
2081 <pre>1 2 README NUL
2082 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</pre>
2083 </div>
2084 </div>
2085 <div class="paragraph">
2086 <p>That is:</p>
2087 </div>
2088 <div class="olist arabic">
2089 <ol class="arabic">
2090 <li>
2091 <p>the number of added lines;</p>
2092 </li>
2093 <li>
2094 <p>a tab;</p>
2095 </li>
2096 <li>
2097 <p>the number of deleted lines;</p>
2098 </li>
2099 <li>
2100 <p>a tab;</p>
2101 </li>
2102 <li>
2103 <p>a NUL (only exists if renamed/copied);</p>
2104 </li>
2105 <li>
2106 <p>pathname in preimage;</p>
2107 </li>
2108 <li>
2109 <p>a NUL (only exists if renamed/copied);</p>
2110 </li>
2111 <li>
2112 <p>pathname in postimage (only exists if renamed/copied);</p>
2113 </li>
2114 <li>
2115 <p>a NUL.</p>
2116 </li>
2117 </ol>
2118 </div>
2119 <div class="paragraph">
2120 <p>The extra <code>NUL</code> before the preimage path in renamed case is to allow
2121 scripts that read the output to tell if the current record being read is
2122 a single-path record or a rename/copy record without reading ahead.
2123 After reading added and deleted lines, reading up to <code>NUL</code> would yield
2124 the pathname, but if that is <code>NUL</code>, the record will show two paths.</p>
2125 </div>
2126 </div>
2127 </div>
2128 <div class="sect1">
2129 <h2 id="_examples">EXAMPLES</h2>
2130 <div class="sectionbody">
2131 <div class="dlist">
2132 <dl>
2133 <dt class="hdlist1">Various ways to check your working tree</dt>
2134 <dd>
2135 <div class="listingblock">
2136 <div class="content">
2137 <pre>$ git diff <b class="conum">(1)</b>
2138 $ git diff --cached <b class="conum">(2)</b>
2139 $ git diff HEAD <b class="conum">(3)</b>
2140 $ git diff AUTO_MERGE <b class="conum">(4)</b></pre>
2141 </div>
2142 </div>
2143 <div class="colist arabic">
2144 <ol>
2145 <li>
2146 <p>Changes in the working tree not yet staged for the next commit.</p>
2147 </li>
2148 <li>
2149 <p>Changes between the index and your last commit; what you
2150 would be committing if you run <code>git</code> <code>commit</code> without <code>-a</code> option.</p>
2151 </li>
2152 <li>
2153 <p>Changes in the working tree since your last commit; what you
2154 would be committing if you run <code>git</code> <code>commit</code> <code>-a</code></p>
2155 </li>
2156 <li>
2157 <p>Changes in the working tree you&#8217;ve made to resolve textual
2158 conflicts so far.</p>
2159 </li>
2160 </ol>
2161 </div>
2162 </dd>
2163 <dt class="hdlist1">Comparing with arbitrary commits</dt>
2164 <dd>
2165 <div class="listingblock">
2166 <div class="content">
2167 <pre>$ git diff test <b class="conum">(1)</b>
2168 $ git diff HEAD -- ./test <b class="conum">(2)</b>
2169 $ git diff HEAD^ HEAD <b class="conum">(3)</b></pre>
2170 </div>
2171 </div>
2172 <div class="colist arabic">
2173 <ol>
2174 <li>
2175 <p>Instead of using the tip of the current branch, compare with the
2176 tip of "test" branch.</p>
2177 </li>
2178 <li>
2179 <p>Instead of comparing with the tip of "test" branch, compare with
2180 the tip of the current branch, but limit the comparison to the
2181 file "test".</p>
2182 </li>
2183 <li>
2184 <p>Compare the version before the last commit and the last commit.</p>
2185 </li>
2186 </ol>
2187 </div>
2188 </dd>
2189 <dt class="hdlist1">Comparing branches</dt>
2190 <dd>
2191 <div class="listingblock">
2192 <div class="content">
2193 <pre>$ git diff topic master <b class="conum">(1)</b>
2194 $ git diff topic..master <b class="conum">(2)</b>
2195 $ git diff topic...master <b class="conum">(3)</b></pre>
2196 </div>
2197 </div>
2198 <div class="colist arabic">
2199 <ol>
2200 <li>
2201 <p>Changes between the tips of the topic and the master branches.</p>
2202 </li>
2203 <li>
2204 <p>Same as above.</p>
2205 </li>
2206 <li>
2207 <p>Changes that occurred on the master branch since when the topic
2208 branch was started off it.</p>
2209 </li>
2210 </ol>
2211 </div>
2212 </dd>
2213 <dt class="hdlist1">Limiting the diff output</dt>
2214 <dd>
2215 <div class="listingblock">
2216 <div class="content">
2217 <pre>$ git diff --diff-filter=MRC <b class="conum">(1)</b>
2218 $ git diff --name-status <b class="conum">(2)</b>
2219 $ git diff arch/i386 include/asm-i386 <b class="conum">(3)</b></pre>
2220 </div>
2221 </div>
2222 <div class="colist arabic">
2223 <ol>
2224 <li>
2225 <p>Show only modification, rename, and copy, but not addition
2226 or deletion.</p>
2227 </li>
2228 <li>
2229 <p>Show only names and the nature of change, but not actual
2230 diff output.</p>
2231 </li>
2232 <li>
2233 <p>Limit diff output to named subtrees.</p>
2234 </li>
2235 </ol>
2236 </div>
2237 </dd>
2238 <dt class="hdlist1">Munging the diff output</dt>
2239 <dd>
2240 <div class="listingblock">
2241 <div class="content">
2242 <pre>$ git diff --find-copies-harder -B -C <b class="conum">(1)</b>
2243 $ git diff -R <b class="conum">(2)</b></pre>
2244 </div>
2245 </div>
2246 <div class="colist arabic">
2247 <ol>
2248 <li>
2249 <p>Spend extra cycles to find renames, copies and complete
2250 rewrites (very expensive).</p>
2251 </li>
2252 <li>
2253 <p>Output diff in reverse.</p>
2254 </li>
2255 </ol>
2256 </div>
2257 </dd>
2258 </dl>
2259 </div>
2260 </div>
2261 </div>
2262 <div class="sect1">
2263 <h2 id="_configuration">CONFIGURATION</h2>
2264 <div class="sectionbody">
2265 <div class="paragraph">
2266 <p>Everything below this line in this section is selectively included
2267 from the <a href="git-config.html">git-config(1)</a> documentation. The content is the same
2268 as what&#8217;s found there:</p>
2269 </div>
2270 <div class="dlist">
2271 <dl>
2272 <dt class="hdlist1">diff.autoRefreshIndex</dt>
2273 <dd>
2274 <p>When using <em>git diff</em> to compare with work tree
2275 files, do not consider stat-only changes as changed.
2276 Instead, silently run <code>git</code> <code>update-index</code> <code>--refresh</code> to
2277 update the cached stat information for paths whose
2278 contents in the work tree match the contents in the
2279 index. This option defaults to true. Note that this
2280 affects only <em>git diff</em> Porcelain, and not lower level
2281 <em>diff</em> commands such as <em>git diff-files</em>.</p>
2282 </dd>
2283 <dt class="hdlist1">diff.dirstat</dt>
2284 <dd>
2285 <p>A comma separated list of <code>--dirstat</code> parameters specifying the
2286 default behavior of the <code>--dirstat</code> option to <a href="git-diff.html">git-diff(1)</a>
2287 and friends. The defaults can be overridden on the command line
2288 (using <code>--dirstat=</code>&lt;param1,param2,<code>...</code>&gt;). The fallback defaults
2289 (when not changed by <code>diff.dirstat</code>) are <code>changes,noncumulative,3</code>.
2290 The following parameters are available:</p>
2291 <div class="openblock">
2292 <div class="content">
2293 <div class="dlist">
2294 <dl>
2295 <dt class="hdlist1"><code>changes</code></dt>
2296 <dd>
2297 <p>Compute the dirstat numbers by counting the lines that have been
2298 removed from the source, or added to the destination. This ignores
2299 the amount of pure code movements within a file. In other words,
2300 rearranging lines in a file is not counted as much as other changes.
2301 This is the default behavior when no parameter is given.</p>
2302 </dd>
2303 <dt class="hdlist1"><code>lines</code></dt>
2304 <dd>
2305 <p>Compute the dirstat numbers by doing the regular line-based diff
2306 analysis, and summing the removed/added line counts. (For binary
2307 files, count 64-byte chunks instead, since binary files have no
2308 natural concept of lines). This is a more expensive <code>--dirstat</code>
2309 behavior than the <code>changes</code> behavior, but it does count rearranged
2310 lines within a file as much as other changes. The resulting output
2311 is consistent with what you get from the other <code>--</code>*stat options.</p>
2312 </dd>
2313 <dt class="hdlist1"><code>files</code></dt>
2314 <dd>
2315 <p>Compute the dirstat numbers by counting the number of files changed.
2316 Each changed file counts equally in the dirstat analysis. This is
2317 the computationally cheapest <code>--dirstat</code> behavior, since it does
2318 not have to look at the file contents at all.</p>
2319 </dd>
2320 <dt class="hdlist1"><code>cumulative</code></dt>
2321 <dd>
2322 <p>Count changes in a child directory for the parent directory as well.
2323 Note that when using <code>cumulative</code>, the sum of the percentages
2324 reported may exceed 100%. The default (non-cumulative) behavior can
2325 be specified with the <code>noncumulative</code> parameter.</p>
2326 </dd>
2327 <dt class="hdlist1">&lt;limit&gt;</dt>
2328 <dd>
2329 <p>An integer parameter specifies a cut-off percent (3% by default).
2330 Directories contributing less than this percentage of the changes
2331 are not shown in the output.</p>
2332 </dd>
2333 </dl>
2334 </div>
2335 </div>
2336 </div>
2337 <div class="paragraph">
2338 <p>Example: The following will count changed files, while ignoring
2339 directories with less than 10% of the total amount of changed files,
2340 and accumulating child directory counts in the parent directories:
2341 <code>files,10,cumulative</code>.</p>
2342 </div>
2343 </dd>
2344 <dt class="hdlist1">diff.statNameWidth</dt>
2345 <dd>
2346 <p>Limit the width of the filename part in --stat output. If set, applies
2347 to all commands generating --stat output except format-patch.</p>
2348 </dd>
2349 <dt class="hdlist1">diff.statGraphWidth</dt>
2350 <dd>
2351 <p>Limit the width of the graph part in --stat output. If set, applies
2352 to all commands generating --stat output except format-patch.</p>
2353 </dd>
2354 <dt class="hdlist1">diff.context</dt>
2355 <dd>
2356 <p>Generate diffs with &lt;n&gt; lines of context instead of the default
2357 of 3. This value is overridden by the -U option.</p>
2358 </dd>
2359 <dt class="hdlist1">diff.interHunkContext</dt>
2360 <dd>
2361 <p>Show the context between diff hunks, up to the specified number
2362 of lines, thereby fusing the hunks that are close to each other.
2363 This value serves as the default for the <code>--inter-hunk-context</code>
2364 command line option.</p>
2365 </dd>
2366 <dt class="hdlist1">diff.external</dt>
2367 <dd>
2368 <p>If this config variable is set, diff generation is not
2369 performed using the internal diff machinery, but using the
2370 given command. Can be overridden with the &#8216;GIT_EXTERNAL_DIFF&#8217;
2371 environment variable. The command is called with parameters
2372 as described under "git Diffs" in <a href="git.html">git(1)</a>. Note: if
2373 you want to use an external diff program only on a subset of
2374 your files, you might want to use <a href="gitattributes.html">gitattributes(5)</a> instead.</p>
2375 </dd>
2376 <dt class="hdlist1">diff.trustExitCode</dt>
2377 <dd>
2378 <p>If this boolean value is set to true then the
2379 <code>diff.external</code> command is expected to return exit code
2380 0 if it considers the input files to be equal or 1 if it
2381 considers them to be different, like <code>diff</code>(<code>1</code>).
2382 If it is set to false, which is the default, then the command
2383 is expected to return exit code 0 regardless of equality.
2384 Any other exit code causes Git to report a fatal error.</p>
2385 </dd>
2386 <dt class="hdlist1">diff.ignoreSubmodules</dt>
2387 <dd>
2388 <p>Sets the default value of --ignore-submodules. Note that this
2389 affects only <em>git diff</em> Porcelain, and not lower level <em>diff</em>
2390 commands such as <em>git diff-files</em>. <em>git checkout</em>
2391 and <em>git switch</em> also honor
2392 this setting when reporting uncommitted changes. Setting it to
2393 <em>all</em> disables the submodule summary normally shown by <em>git commit</em>
2394 and <em>git status</em> when <code>status.submoduleSummary</code> is set unless it is
2395 overridden by using the --ignore-submodules command-line option.
2396 The <em>git submodule</em> commands are not affected by this setting.
2397 By default this is set to untracked so that any untracked
2398 submodules are ignored.</p>
2399 </dd>
2400 <dt class="hdlist1">diff.mnemonicPrefix</dt>
2401 <dd>
2402 <p>If set, <em>git diff</em> uses a prefix pair that is different from the
2403 standard "a/" and "b/" depending on what is being compared. When
2404 this configuration is in effect, reverse diff output also swaps
2405 the order of the prefixes:</p>
2406 <div class="dlist">
2407 <dl>
2408 <dt class="hdlist1"><code>git</code> <code>diff</code></dt>
2409 <dd>
2410 <p>compares the (i)ndex and the (w)ork tree;</p>
2411 </dd>
2412 <dt class="hdlist1"><code>git</code> <code>diff</code> <code>HEAD</code></dt>
2413 <dd>
2414 <p>compares a (c)ommit and the (w)ork tree;</p>
2415 </dd>
2416 <dt class="hdlist1"><code>git</code> <code>diff</code> <code>--cached</code></dt>
2417 <dd>
2418 <p>compares a (c)ommit and the (i)ndex;</p>
2419 </dd>
2420 <dt class="hdlist1"><code>git</code> <code>diff</code> <code>HEAD:file1</code> <code>file2</code></dt>
2421 <dd>
2422 <p>compares an (o)bject and a (w)ork tree entity;</p>
2423 </dd>
2424 <dt class="hdlist1"><code>git</code> <code>diff</code> <code>--no-index</code> <code>a</code> <code>b</code></dt>
2425 <dd>
2426 <p>compares two non-git things (1) and (2).</p>
2427 </dd>
2428 </dl>
2429 </div>
2430 </dd>
2431 <dt class="hdlist1">diff.noPrefix</dt>
2432 <dd>
2433 <p>If set, <em>git diff</em> does not show any source or destination prefix.</p>
2434 </dd>
2435 <dt class="hdlist1">diff.srcPrefix</dt>
2436 <dd>
2437 <p>If set, <em>git diff</em> uses this source prefix. Defaults to "a/".</p>
2438 </dd>
2439 <dt class="hdlist1">diff.dstPrefix</dt>
2440 <dd>
2441 <p>If set, <em>git diff</em> uses this destination prefix. Defaults to "b/".</p>
2442 </dd>
2443 <dt class="hdlist1">diff.relative</dt>
2444 <dd>
2445 <p>If set to <em>true</em>, <em>git diff</em> does not show changes outside of the directory
2446 and show pathnames relative to the current directory.</p>
2447 </dd>
2448 <dt class="hdlist1">diff.orderFile</dt>
2449 <dd>
2450 <p>File indicating how to order files within a diff.
2451 See the <em>-O</em> option to <a href="git-diff.html">git-diff(1)</a> for details.
2452 If <code>diff.orderFile</code> is a relative pathname, it is treated as
2453 relative to the top of the working tree.</p>
2454 </dd>
2455 <dt class="hdlist1">diff.renameLimit</dt>
2456 <dd>
2457 <p>The number of files to consider in the exhaustive portion of
2458 copy/rename detection; equivalent to the <em>git diff</em> option
2459 <code>-l</code>. If not set, the default value is currently 1000. This
2460 setting has no effect if rename detection is turned off.</p>
2461 </dd>
2462 <dt class="hdlist1">diff.renames</dt>
2463 <dd>
2464 <p>Whether and how Git detects renames. If set to "false",
2465 rename detection is disabled. If set to "true", basic rename
2466 detection is enabled. If set to "copies" or "copy", Git will
2467 detect copies, as well. Defaults to true. Note that this
2468 affects only <em>git diff</em> Porcelain like <a href="git-diff.html">git-diff(1)</a> and
2469 <a href="git-log.html">git-log(1)</a>, and not lower level commands such as
2470 <a href="git-diff-files.html">git-diff-files(1)</a>.</p>
2471 </dd>
2472 <dt class="hdlist1">diff.suppressBlankEmpty</dt>
2473 <dd>
2474 <p>A boolean to inhibit the standard behavior of printing a space
2475 before each empty output line. Defaults to false.</p>
2476 </dd>
2477 <dt class="hdlist1">diff.submodule</dt>
2478 <dd>
2479 <p>Specify the format in which differences in submodules are
2480 shown. The "short" format just shows the names of the commits
2481 at the beginning and end of the range. The "log" format lists
2482 the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code>
2483 does. The "diff" format shows an inline diff of the changed
2484 contents of the submodule. Defaults to "short".</p>
2485 </dd>
2486 <dt class="hdlist1">diff.wordRegex</dt>
2487 <dd>
2488 <p>A POSIX Extended Regular Expression used to determine what is a "word"
2489 when performing word-by-word difference calculations. Character
2490 sequences that match the regular expression are "words", all other
2491 characters are <strong>ignorable</strong> whitespace.</p>
2492 </dd>
2493 <dt class="hdlist1">diff.&lt;driver&gt;.command</dt>
2494 <dd>
2495 <p>The custom diff driver command. See <a href="gitattributes.html">gitattributes(5)</a>
2496 for details.</p>
2497 </dd>
2498 <dt class="hdlist1">diff.&lt;driver&gt;.trustExitCode</dt>
2499 <dd>
2500 <p>If this boolean value is set to true then the
2501 <code>diff.</code><em>&lt;driver&gt;</em><code>.command</code> command is expected to return exit code
2502 0 if it considers the input files to be equal or 1 if it
2503 considers them to be different, like <code>diff</code>(<code>1</code>).
2504 If it is set to false, which is the default, then the command
2505 is expected to return exit code 0 regardless of equality.
2506 Any other exit code causes Git to report a fatal error.</p>
2507 </dd>
2508 <dt class="hdlist1">diff.&lt;driver&gt;.xfuncname</dt>
2509 <dd>
2510 <p>The regular expression that the diff driver should use to
2511 recognize the hunk header. A built-in pattern may also be used.
2512 See <a href="gitattributes.html">gitattributes(5)</a> for details.</p>
2513 </dd>
2514 <dt class="hdlist1">diff.&lt;driver&gt;.binary</dt>
2515 <dd>
2516 <p>Set this option to true to make the diff driver treat files as
2517 binary. See <a href="gitattributes.html">gitattributes(5)</a> for details.</p>
2518 </dd>
2519 <dt class="hdlist1">diff.&lt;driver&gt;.textconv</dt>
2520 <dd>
2521 <p>The command that the diff driver should call to generate the
2522 text-converted version of a file. The result of the
2523 conversion is used to generate a human-readable diff. See
2524 <a href="gitattributes.html">gitattributes(5)</a> for details.</p>
2525 </dd>
2526 <dt class="hdlist1">diff.&lt;driver&gt;.wordRegex</dt>
2527 <dd>
2528 <p>The regular expression that the diff driver should use to
2529 split words in a line. See <a href="gitattributes.html">gitattributes(5)</a> for
2530 details.</p>
2531 </dd>
2532 <dt class="hdlist1">diff.&lt;driver&gt;.cachetextconv</dt>
2533 <dd>
2534 <p>Set this option to true to make the diff driver cache the text
2535 conversion outputs. See <a href="gitattributes.html">gitattributes(5)</a> for details.</p>
2536 <div class="dlist">
2537 <dl>
2538 <dt class="hdlist1"><code>araxis</code></dt>
2539 <dd>
2540 <p>Use Araxis Merge (requires a graphical session)</p>
2541 </dd>
2542 <dt class="hdlist1"><code>bc</code></dt>
2543 <dd>
2544 <p>Use Beyond Compare (requires a graphical session)</p>
2545 </dd>
2546 <dt class="hdlist1"><code>bc3</code></dt>
2547 <dd>
2548 <p>Use Beyond Compare (requires a graphical session)</p>
2549 </dd>
2550 <dt class="hdlist1"><code>bc4</code></dt>
2551 <dd>
2552 <p>Use Beyond Compare (requires a graphical session)</p>
2553 </dd>
2554 <dt class="hdlist1"><code>codecompare</code></dt>
2555 <dd>
2556 <p>Use Code Compare (requires a graphical session)</p>
2557 </dd>
2558 <dt class="hdlist1"><code>deltawalker</code></dt>
2559 <dd>
2560 <p>Use DeltaWalker (requires a graphical session)</p>
2561 </dd>
2562 <dt class="hdlist1"><code>diffmerge</code></dt>
2563 <dd>
2564 <p>Use DiffMerge (requires a graphical session)</p>
2565 </dd>
2566 <dt class="hdlist1"><code>diffuse</code></dt>
2567 <dd>
2568 <p>Use Diffuse (requires a graphical session)</p>
2569 </dd>
2570 <dt class="hdlist1"><code>ecmerge</code></dt>
2571 <dd>
2572 <p>Use ECMerge (requires a graphical session)</p>
2573 </dd>
2574 <dt class="hdlist1"><code>emerge</code></dt>
2575 <dd>
2576 <p>Use Emacs' Emerge</p>
2577 </dd>
2578 <dt class="hdlist1"><code>examdiff</code></dt>
2579 <dd>
2580 <p>Use ExamDiff Pro (requires a graphical session)</p>
2581 </dd>
2582 <dt class="hdlist1"><code>guiffy</code></dt>
2583 <dd>
2584 <p>Use Guiffy&#8217;s Diff Tool (requires a graphical session)</p>
2585 </dd>
2586 <dt class="hdlist1"><code>gvimdiff</code></dt>
2587 <dd>
2588 <p>Use gVim (requires a graphical session)</p>
2589 </dd>
2590 <dt class="hdlist1"><code>kdiff3</code></dt>
2591 <dd>
2592 <p>Use KDiff3 (requires a graphical session)</p>
2593 </dd>
2594 <dt class="hdlist1"><code>kompare</code></dt>
2595 <dd>
2596 <p>Use Kompare (requires a graphical session)</p>
2597 </dd>
2598 <dt class="hdlist1"><code>meld</code></dt>
2599 <dd>
2600 <p>Use Meld (requires a graphical session)</p>
2601 </dd>
2602 <dt class="hdlist1"><code>nvimdiff</code></dt>
2603 <dd>
2604 <p>Use Neovim</p>
2605 </dd>
2606 <dt class="hdlist1"><code>opendiff</code></dt>
2607 <dd>
2608 <p>Use FileMerge (requires a graphical session)</p>
2609 </dd>
2610 <dt class="hdlist1"><code>p4merge</code></dt>
2611 <dd>
2612 <p>Use HelixCore P4Merge (requires a graphical session)</p>
2613 </dd>
2614 <dt class="hdlist1"><code>smerge</code></dt>
2615 <dd>
2616 <p>Use Sublime Merge (requires a graphical session)</p>
2617 </dd>
2618 <dt class="hdlist1"><code>tkdiff</code></dt>
2619 <dd>
2620 <p>Use TkDiff (requires a graphical session)</p>
2621 </dd>
2622 <dt class="hdlist1"><code>vimdiff</code></dt>
2623 <dd>
2624 <p>Use Vim</p>
2625 </dd>
2626 <dt class="hdlist1"><code>vscode</code></dt>
2627 <dd>
2628 <p>Use Visual Studio Code (requires a graphical session)</p>
2629 </dd>
2630 <dt class="hdlist1"><code>winmerge</code></dt>
2631 <dd>
2632 <p>Use WinMerge (requires a graphical session)</p>
2633 </dd>
2634 <dt class="hdlist1"><code>xxdiff</code></dt>
2635 <dd>
2636 <p>Use xxdiff (requires a graphical session)</p>
2637 </dd>
2638 </dl>
2639 </div>
2640 </dd>
2641 <dt class="hdlist1">diff.indentHeuristic</dt>
2642 <dd>
2643 <p>Set this option to <code>false</code> to disable the default heuristics
2644 that shift diff hunk boundaries to make patches easier to read.</p>
2645 </dd>
2646 <dt class="hdlist1">diff.algorithm</dt>
2647 <dd>
2648 <p>Choose a diff algorithm. The variants are as follows:</p>
2649 <div class="openblock">
2650 <div class="content">
2651 <div class="dlist">
2652 <dl>
2653 <dt class="hdlist1"><code>default</code>, <code>myers</code></dt>
2654 <dd>
2655 <p>The basic greedy diff algorithm. Currently, this is the default.</p>
2656 </dd>
2657 <dt class="hdlist1"><code>minimal</code></dt>
2658 <dd>
2659 <p>Spend extra time to make sure the smallest possible diff is
2660 produced.</p>
2661 </dd>
2662 <dt class="hdlist1"><code>patience</code></dt>
2663 <dd>
2664 <p>Use "patience diff" algorithm when generating patches.</p>
2665 </dd>
2666 <dt class="hdlist1"><code>histogram</code></dt>
2667 <dd>
2668 <p>This algorithm extends the patience algorithm to "support
2669 low-occurrence common elements".</p>
2670 </dd>
2671 </dl>
2672 </div>
2673 </div>
2674 </div>
2675 </dd>
2676 <dt class="hdlist1">diff.wsErrorHighlight</dt>
2677 <dd>
2678 <p>Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
2679 lines of the diff. Multiple values are separated by comma,
2680 <code>none</code> resets previous values, <code>default</code> reset the list to
2681 <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. The
2682 whitespace errors are colored with <code>color.diff.whitespace</code>.
2683 The command line option <code>--ws-error-highlight=</code><em>&lt;kind&gt;</em>
2684 overrides this setting.</p>
2685 </dd>
2686 <dt class="hdlist1">diff.colorMoved</dt>
2687 <dd>
2688 <p>If set to either a valid <em>&lt;mode&gt;</em> or a true value, moved lines
2689 in a diff are colored differently, for details of valid modes
2690 see <em>--color-moved</em> in <a href="git-diff.html">git-diff(1)</a>. If simply set to
2691 true the default color mode will be used. When set to false,
2692 moved lines are not colored.</p>
2693 </dd>
2694 <dt class="hdlist1">diff.colorMovedWS</dt>
2695 <dd>
2696 <p>When moved lines are colored using e.g. the <code>diff.colorMoved</code> setting,
2697 this option controls the <em>&lt;mode&gt;</em> how spaces are treated.
2698 For details of valid modes see <em>--color-moved-ws</em> in <a href="git-diff.html">git-diff(1)</a>.</p>
2699 </dd>
2700 </dl>
2701 </div>
2702 </div>
2703 </div>
2704 <div class="sect1">
2705 <h2 id="_see_also">SEE ALSO</h2>
2706 <div class="sectionbody">
2707 <div class="paragraph">
2708 <p>diff(1),
2709 <a href="git-difftool.html">git-difftool(1)</a>,
2710 <a href="git-log.html">git-log(1)</a>,
2711 <a href="gitdiffcore.html">gitdiffcore(7)</a>,
2712 <a href="git-format-patch.html">git-format-patch(1)</a>,
2713 <a href="git-apply.html">git-apply(1)</a>,
2714 <a href="git-show.html">git-show(1)</a></p>
2715 </div>
2716 </div>
2717 </div>
2718 <div class="sect1">
2719 <h2 id="_git">GIT</h2>
2720 <div class="sectionbody">
2721 <div class="paragraph">
2722 <p>Part of the <a href="git.html">git(1)</a> suite</p>
2723 </div>
2724 </div>
2725 </div>
2726 </div>
2727 <div id="footer">
2728 <div id="footer-text">
2729 Last updated 2023-12-27 15:50:18 -0800
2730 </div>
2731 </div>
2732 </body>
2733 </html>