2 <html xmlns=
"http://www.w3.org/1999/xhtml" lang=
"en">
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-format-patch(
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"/>
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%}
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}
21 abbr[title]{cursor:help;border-bottom:
1px dotted #dddddf;text-decoration:none}
22 dfn{font-style:italic}
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"}
29 sub,sup{font-size:
75%;line-height:
0;position:relative;vertical-align:baseline}
33 svg:not(:root){overflow:hidden}
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}
62 img,object,svg{display:inline-block;vertical-align:middle}
63 textarea{height:auto;min-height:
50px}
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}
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}
75 h2{font-size:
1.6875em}
76 h3,#toctitle,.sidebarblock
>.content
>.title{font-size:
1.375em}
77 h4,h5{font-size:
1.125em}
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}
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}
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}
344 .aqua-background{background:#
00fafa}
346 .black-background{background:#
000}
348 .blue-background{background:#
0000fa}
349 .fuchsia{color:#bf00bf}
350 .fuchsia-background{background:#fa00fa}
352 .gray-background{background:#
7d7d7d}
353 .green{color:#
006000}
354 .green-background{background:#
007d00}
356 .lime-background{background:#
00fa00}
357 .maroon{color:#
600000}
358 .maroon-background{background:#
7d0000}
360 .navy-background{background:#
00007d}
361 .olive{color:#
606000}
362 .olive-background{background:#
7d7d00}
363 .purple{color:#
600060}
364 .purple-background{background:#
7d007d}
366 .red-background{background:#fa0000}
367 .silver{color:#
909090}
368 .silver-background{background:#bcbcbc}
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}
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}
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}}
441 <body class=
"manpage">
443 <h1>git-format-patch(
1) Manual Page
</h1>
444 <h2 id=
"_name">NAME
</h2>
445 <div class=
"sectionbody">
446 <p>git-format-patch - Prepare patches for e-mail submission
</p>
451 <h2 id=
"_synopsis">SYNOPSIS
</h2>
452 <div class=
"sectionbody">
453 <div class=
"verseblock">
454 <pre class=
"content"><em>git format-patch
</em> [-k] [(-o|--output-directory)
<dir
> | --stdout]
455 [--no-thread | --thread[=
<style
>]]
456 [(--attach|--inline)[=
<boundary
>] | --no-attach]
458 [--signature=
<signature
> | --no-signature]
459 [--signature-file=
<file
>]
460 [-n | --numbered | -N | --no-numbered]
461 [--start-number
<n
>] [--numbered-files]
462 [--in-reply-to=
<message-id
>] [--suffix=.
<sfx
>]
463 [--ignore-if-in-upstream] [--always]
464 [--cover-from-description=
<mode
>]
465 [--rfc[=
<rfc
>]] [--subject-prefix=
<subject-prefix
>]
466 [(--reroll-count|-v)
<n
>]
467 [--to=
<email
>] [--cc=
<email
>]
468 [--[no-]cover-letter] [--quiet]
469 [--[no-]encode-email-headers]
470 [--no-notes | --notes[=
<ref
>]]
471 [--interdiff=
<previous
>]
472 [--range-diff=
<previous
> [--creation-factor=
<percent
>]]
473 [--filename-max-length=
<n
>]
475 [
<common-diff-options
>]
476 [
<since
> |
<revision-range
> ]
</pre>
481 <h2 id=
"_description">DESCRIPTION
</h2>
482 <div class=
"sectionbody">
483 <div class=
"paragraph">
484 <p>Prepare each non-merge commit with its
"patch" in
485 one
"message" per commit, formatted to resemble a UNIX mailbox.
486 The output of this command is convenient for e-mail submission or
487 for use with
<em>git am
</em>.
</p>
489 <div class=
"paragraph">
490 <p>A
"message" generated by the command consists of three parts:
</p>
495 <p>A brief metadata header that begins with
<code>From
</code> <em><commit
></em>
496 with a fixed
<code>Mon
</code> <code>Sep
</code> <code>17</code> <code>00:
00:
00</code> <code>2001</code> datestamp to help programs
497 like
"file(1)" to recognize that the file is an output from this
498 command, fields that record the author identity, the author date,
499 and the title of the change (taken from the first paragraph of the
500 commit log message).
</p>
503 <p>The second and subsequent paragraphs of the commit log message.
</p>
506 <p>The
"patch", which is the
"diff -p --stat" output (see
507 <a href=
"git-diff.html">git-diff(
1)
</a>) between the commit and its parent.
</p>
511 <div class=
"paragraph">
512 <p>The log message and the patch are separated by a line with a
515 <div class=
"paragraph">
516 <p>There are two ways to specify which commits to operate on.
</p>
518 <div class=
"olist arabic">
521 <p>A single commit,
<since
>, specifies that the commits leading
522 to the tip of the current branch that are not in the history
523 that leads to the
<since
> to be output.
</p>
526 <p>Generic
<revision-range
> expression (see
"SPECIFYING
527 REVISIONS" section in
<a href=
"gitrevisions.html">gitrevisions(
7)
</a>) means the
528 commits in the specified range.
</p>
532 <div class=
"paragraph">
533 <p>The first rule takes precedence in the case of a single
<commit
>. To
534 apply the second rule, i.e., format everything since the beginning of
535 history up until
<commit
>, use the
<code>--root
</code> option:
<code>git
</code> <code>format-patch
</code>
536 <code>--root
</code> <em><commit
></em>. If you want to format only
<commit
> itself, you
537 can do this with
<code>git
</code> <code>format-patch
</code> <code>-
1</code> <em><commit
></em>.
</p>
539 <div class=
"paragraph">
540 <p>By default, each output file is numbered sequentially from
1, and uses the
541 first line of the commit message (massaged for pathname safety) as
542 the filename. With the
<code>--numbered-files
</code> option, the output file names
543 will only be numbers, without the first line of the commit appended.
544 The names of the output files are printed to standard
545 output, unless the
<code>--stdout
</code> option is specified.
</p>
547 <div class=
"paragraph">
548 <p>If
<code>-o
</code> is specified, output files are created in
<dir
>. Otherwise
549 they are created in the current working directory. The default path
550 can be set with the
<code>format.outputDirectory
</code> configuration option.
551 The
<code>-o
</code> option takes precedence over
<code>format.outputDirectory
</code>.
552 To store patches in the current working directory even when
553 <code>format.outputDirectory
</code> points elsewhere, use
<code>-o
</code> .. All directory
554 components will be created.
</p>
556 <div class=
"paragraph">
557 <p>By default, the subject of a single patch is
"[PATCH] " followed by
558 the concatenation of lines from the commit message up to the first blank
559 line (see the DISCUSSION section of
<a href=
"git-commit.html">git-commit(
1)
</a>).
</p>
561 <div class=
"paragraph">
562 <p>When multiple patches are output, the subject prefix will instead be
563 "[PATCH n/m] ". To force
1/
1 to be added for a single patch, use
<code>-n
</code>.
564 To omit patch numbers from the subject, use
<code>-N
</code>.
</p>
566 <div class=
"paragraph">
567 <p>If given
<code>--thread
</code>,
<code>git-format-patch
</code> will generate
<code>In-Reply-To
</code> and
568 <code>References
</code> headers to make the second and subsequent patch mails appear
569 as replies to the first mail; this also generates a
<code>Message-ID
</code> header to
575 <h2 id=
"_options">OPTIONS
</h2>
576 <div class=
"sectionbody">
579 <dt class=
"hdlist1">-p
</dt>
580 <dt class=
"hdlist1">--no-stat
</dt>
582 <p>Generate plain patches without any diffstats.
</p>
584 <dt class=
"hdlist1">-U
<n
></dt>
585 <dt class=
"hdlist1">--unified=
<n
></dt>
587 <p>Generate diffs with
<n
> lines of context instead of
590 <dt class=
"hdlist1">--output=
<file
></dt>
592 <p>Output to a specific file instead of stdout.
</p>
594 <dt class=
"hdlist1">--output-indicator-new=
<char
></dt>
595 <dt class=
"hdlist1">--output-indicator-old=
<char
></dt>
596 <dt class=
"hdlist1">--output-indicator-context=
<char
></dt>
598 <p>Specify the character used to indicate new, old or context
599 lines in the generated patch. Normally they are
<em>+
</em>,
<em>-
</em> and
600 ' ' respectively.
</p>
602 <dt class=
"hdlist1">--indent-heuristic
</dt>
604 <p>Enable the heuristic that shifts diff hunk boundaries to make patches
605 easier to read. This is the default.
</p>
607 <dt class=
"hdlist1">--no-indent-heuristic
</dt>
609 <p>Disable the indent heuristic.
</p>
611 <dt class=
"hdlist1">--minimal
</dt>
613 <p>Spend extra time to make sure the smallest possible
614 diff is produced.
</p>
616 <dt class=
"hdlist1">--patience
</dt>
618 <p>Generate a diff using the
"patience diff" algorithm.
</p>
620 <dt class=
"hdlist1">--histogram
</dt>
622 <p>Generate a diff using the
"histogram diff" algorithm.
</p>
624 <dt class=
"hdlist1">--anchored=
<text
></dt>
626 <p>Generate a diff using the
"anchored diff" algorithm.
</p>
627 <div class=
"paragraph">
628 <p>This option may be specified more than once.
</p>
630 <div class=
"paragraph">
631 <p>If a line exists in both the source and destination, exists only once,
632 and starts with this text, this algorithm attempts to prevent it from
633 appearing as a deletion or addition in the output. It uses the
"patience
634 diff" algorithm internally.
</p>
637 <dt class=
"hdlist1">--diff-algorithm={patience|minimal|histogram|myers}
</dt>
639 <p>Choose a diff algorithm. The variants are as follows:
</p>
640 <div class=
"openblock">
641 <div class=
"content">
644 <dt class=
"hdlist1"><code>default
</code>,
<code>myers
</code></dt>
646 <p>The basic greedy diff algorithm. Currently, this is the default.
</p>
648 <dt class=
"hdlist1"><code>minimal
</code></dt>
650 <p>Spend extra time to make sure the smallest possible diff is
653 <dt class=
"hdlist1"><code>patience
</code></dt>
655 <p>Use
"patience diff" algorithm when generating patches.
</p>
657 <dt class=
"hdlist1"><code>histogram
</code></dt>
659 <p>This algorithm extends the patience algorithm to
"support
660 low-occurrence common elements".
</p>
666 <div class=
"paragraph">
667 <p>For instance, if you configured the
<code>diff.algorithm
</code> variable to a
668 non-default value and want to use the default one, then you
669 have to use
<code>--diff-algorithm=default
</code> option.
</p>
672 <dt class=
"hdlist1">--stat[=
<width
>[,
<name-width
>[,
<count
>]]]
</dt>
674 <p>Generate a diffstat. By default, as much space as necessary
675 will be used for the filename part, and the rest for the graph
676 part. Maximum width defaults to terminal width, or
80 columns
677 if not connected to a terminal, and can be overridden by
678 <em><width
></em>. The width of the filename part can be limited by
679 giving another width
<em><name-width
></em> after a comma or by setting
680 <code>diff.statNameWidth=
</code><em><width
></em>. The width of the graph part can be
681 limited by using
<code>--stat-graph-width=
</code><em><width
></em> or by setting
682 <code>diff.statGraphWidth=
</code><em><width
></em>. Using
<code>--stat
</code> or
683 <code>--stat-graph-width
</code> affects all commands generating a stat graph,
684 while setting
<code>diff.statNameWidth
</code> or
<code>diff.statGraphWidth
</code>
685 does not affect
<code>git
</code> <code>format-patch
</code>.
686 By giving a third parameter
<em><count
></em>, you can limit the output to
687 the first
<em><count
></em> lines, followed by ... if there are more.
</p>
688 <div class=
"paragraph">
689 <p>These parameters can also be set individually with
<code>--stat-width=
</code><em><width
></em>,
690 <code>--stat-name-width=
</code><em><name-width
></em> and
<code>--stat-count=
</code><em><count
></em>.
</p>
693 <dt class=
"hdlist1">--compact-summary
</dt>
695 <p>Output a condensed summary of extended header information such
696 as file creations or deletions (
"new" or
"gone", optionally
"+l"
697 if it
’s a symlink) and mode changes (
"+x" or
"-x" for adding
698 or removing executable bit respectively) in diffstat. The
699 information is put between the filename part and the graph
700 part. Implies
<code>--stat
</code>.
</p>
702 <dt class=
"hdlist1">--numstat
</dt>
704 <p>Similar to
<code>--stat
</code>, but shows number of added and
705 deleted lines in decimal notation and pathname without
706 abbreviation, to make it more machine friendly. For
707 binary files, outputs two
<code>-
</code> instead of saying
708 <code>0</code> <code>0</code>.
</p>
710 <dt class=
"hdlist1">--shortstat
</dt>
712 <p>Output only the last line of the
<code>--stat
</code> format containing total
713 number of modified files, as well as number of added and deleted
716 <dt class=
"hdlist1">-X[
<param1,param2,
…​>]
</dt>
717 <dt class=
"hdlist1">--dirstat[=
<param1,param2,
…​>]
</dt>
719 <p>Output the distribution of relative amount of changes for each
720 sub-directory. The behavior of
<code>--dirstat
</code> can be customized by
721 passing it a comma separated list of parameters.
722 The defaults are controlled by the
<code>diff.dirstat
</code> configuration
723 variable (see
<a href=
"git-config.html">git-config(
1)
</a>).
724 The following parameters are available:
</p>
725 <div class=
"openblock">
726 <div class=
"content">
729 <dt class=
"hdlist1"><code>changes
</code></dt>
731 <p>Compute the dirstat numbers by counting the lines that have been
732 removed from the source, or added to the destination. This ignores
733 the amount of pure code movements within a file. In other words,
734 rearranging lines in a file is not counted as much as other changes.
735 This is the default behavior when no parameter is given.
</p>
737 <dt class=
"hdlist1"><code>lines
</code></dt>
739 <p>Compute the dirstat numbers by doing the regular line-based diff
740 analysis, and summing the removed/added line counts. (For binary
741 files, count
64-byte chunks instead, since binary files have no
742 natural concept of lines). This is a more expensive
<code>--dirstat
</code>
743 behavior than the
<code>changes
</code> behavior, but it does count rearranged
744 lines within a file as much as other changes. The resulting output
745 is consistent with what you get from the other
<code>--
</code>*stat options.
</p>
747 <dt class=
"hdlist1"><code>files
</code></dt>
749 <p>Compute the dirstat numbers by counting the number of files changed.
750 Each changed file counts equally in the dirstat analysis. This is
751 the computationally cheapest
<code>--dirstat
</code> behavior, since it does
752 not have to look at the file contents at all.
</p>
754 <dt class=
"hdlist1"><code>cumulative
</code></dt>
756 <p>Count changes in a child directory for the parent directory as well.
757 Note that when using
<code>cumulative
</code>, the sum of the percentages
758 reported may exceed
100%. The default (non-cumulative) behavior can
759 be specified with the
<code>noncumulative
</code> parameter.
</p>
761 <dt class=
"hdlist1"><limit
></dt>
763 <p>An integer parameter specifies a cut-off percent (
3% by default).
764 Directories contributing less than this percentage of the changes
765 are not shown in the output.
</p>
771 <div class=
"paragraph">
772 <p>Example: The following will count changed files, while ignoring
773 directories with less than
10% of the total amount of changed files,
774 and accumulating child directory counts in the parent directories:
775 <code>--dirstat=files,
10,cumulative
</code>.
</p>
778 <dt class=
"hdlist1">--cumulative
</dt>
780 <p>Synonym for --dirstat=cumulative
</p>
782 <dt class=
"hdlist1">--dirstat-by-file[=
<param1,param2
>…​]
</dt>
784 <p>Synonym for --dirstat=files,
<param1
>,
<param2
>…​</p>
786 <dt class=
"hdlist1">--summary
</dt>
788 <p>Output a condensed summary of extended header information
789 such as creations, renames and mode changes.
</p>
791 <dt class=
"hdlist1">--no-renames
</dt>
793 <p>Turn off rename detection, even when the configuration
794 file gives the default to do so.
</p>
796 <dt class=
"hdlist1">--[no-]rename-empty
</dt>
798 <p>Whether to use empty blobs as rename source.
</p>
800 <dt class=
"hdlist1">--full-index
</dt>
802 <p>Instead of the first handful of characters, show the full
803 pre- and post-image blob object names on the
"index"
804 line when generating patch format output.
</p>
806 <dt class=
"hdlist1">--binary
</dt>
808 <p>In addition to
<code>--full-index
</code>, output a binary diff that
809 can be applied with
<code>git-apply
</code>.
</p>
811 <dt class=
"hdlist1">--abbrev[=
<n
>]
</dt>
813 <p>Instead of showing the full
40-byte hexadecimal object
814 name in diff-raw format output and diff-tree header
815 lines, show the shortest prefix that is at least
<em><n
></em>
816 hexdigits long that uniquely refers the object.
817 In diff-patch output format,
<code>--full-index
</code> takes higher
818 precedence, i.e. if
<code>--full-index
</code> is specified, full blob
819 names will be shown regardless of
<code>--abbrev
</code>.
820 Non default number of digits can be specified with
<code>--abbrev=
</code><em><n
></em>.
</p>
822 <dt class=
"hdlist1">-B[
<n
>][/
<m
>]
</dt>
823 <dt class=
"hdlist1">--break-rewrites[=[
<n
>][/
<m
>]]
</dt>
825 <p>Break complete rewrite changes into pairs of delete and
826 create. This serves two purposes:
</p>
827 <div class=
"paragraph">
828 <p>It affects the way a change that amounts to a total rewrite of a file
829 not as a series of deletion and insertion mixed together with a very
830 few lines that happen to match textually as the context, but as a
831 single deletion of everything old followed by a single insertion of
832 everything new, and the number
<code>m
</code> controls this aspect of the -B
833 option (defaults to
60%).
<code>-B/
70</code>% specifies that less than
30% of the
834 original should remain in the result for Git to consider it a total
835 rewrite (i.e. otherwise the resulting patch will be a series of
836 deletion and insertion mixed together with context lines).
</p>
838 <div class=
"paragraph">
839 <p>When used with -M, a totally-rewritten file is also considered as the
840 source of a rename (usually -M only considers a file that disappeared
841 as the source of a rename), and the number
<code>n
</code> controls this aspect of
842 the -B option (defaults to
50%).
<code>-B20
</code>% specifies that a change with
843 addition and deletion compared to
20% or more of the file
’s size are
844 eligible for being picked up as a possible source of a rename to
848 <dt class=
"hdlist1">-M[
<n
>]
</dt>
849 <dt class=
"hdlist1">--find-renames[=
<n
>]
</dt>
852 If
<code>n
</code> is specified, it is a threshold on the similarity
853 index (i.e. amount of addition/deletions compared to the
854 file
’s size). For example,
<code>-M90
</code>% means Git should consider a
855 delete/add pair to be a rename if more than
90% of the file
856 hasn
’t changed. Without a % sign, the number is to be read as
857 a fraction, with a decimal point before it. I.e.,
<code>-M5
</code> becomes
858 0.5, and is thus the same as
<code>-M50
</code>%. Similarly,
<code>-M05
</code> is
859 the same as
<code>-M5
</code>%. To limit detection to exact renames, use
860 <code>-M100
</code>%. The default similarity index is
50%.
</p>
862 <dt class=
"hdlist1">-C[
<n
>]
</dt>
863 <dt class=
"hdlist1">--find-copies[=
<n
>]
</dt>
865 <p>Detect copies as well as renames. See also
<code>--find-copies-harder
</code>.
866 If
<code>n
</code> is specified, it has the same meaning as for
<code>-M
</code><em><n
></em>.
</p>
868 <dt class=
"hdlist1">--find-copies-harder
</dt>
870 <p>For performance reasons, by default,
<code>-C
</code> option finds copies only
871 if the original file of the copy was modified in the same
872 changeset. This flag makes the command
873 inspect unmodified files as candidates for the source of
874 copy. This is a very expensive operation for large
875 projects, so use it with caution. Giving more than one
876 <code>-C
</code> option has the same effect.
</p>
878 <dt class=
"hdlist1">-D
</dt>
879 <dt class=
"hdlist1">--irreversible-delete
</dt>
881 <p>Omit the preimage for deletes, i.e. print only the header but not
882 the diff between the preimage and
<code>/dev/null
</code>. The resulting patch
883 is not meant to be applied with
<code>patch
</code> or
<code>git
</code> <code>apply
</code>; this is
884 solely for people who want to just concentrate on reviewing the
885 text after the change. In addition, the output obviously lacks
886 enough information to apply such a patch in reverse, even manually,
887 hence the name of the option.
</p>
888 <div class=
"paragraph">
889 <p>When used together with
<code>-B
</code>, omit also the preimage in the deletion part
890 of a delete/create pair.
</p>
893 <dt class=
"hdlist1">-l
<num
></dt>
895 <p>The
<code>-M
</code> and
<code>-C
</code> options involve some preliminary steps that
896 can detect subsets of renames/copies cheaply, followed by an
897 exhaustive fallback portion that compares all remaining
898 unpaired destinations to all relevant sources. (For renames,
899 only remaining unpaired sources are relevant; for copies, all
900 original sources are relevant.) For N sources and
901 destinations, this exhaustive check is O(N^
2). This option
902 prevents the exhaustive portion of rename/copy detection from
903 running if the number of source/destination files involved
904 exceeds the specified number. Defaults to diff.renameLimit.
905 Note that a value of
0 is treated as unlimited.
</p>
907 <dt class=
"hdlist1">-O
<orderfile
></dt>
909 <p>Control the order in which files appear in the output.
910 This overrides the
<code>diff.orderFile
</code> configuration variable
911 (see
<a href=
"git-config.html">git-config(
1)
</a>). To cancel
<code>diff.orderFile
</code>,
912 use
<code>-O/dev/null
</code>.
</p>
913 <div class=
"paragraph">
914 <p>The output order is determined by the order of glob patterns in
916 All files with pathnames that match the first pattern are output
917 first, all files with pathnames that match the second pattern (but not
918 the first) are output next, and so on.
919 All files with pathnames that do not match any pattern are output
920 last, as if there was an implicit match-all pattern at the end of the
922 If multiple pathnames have the same rank (they match the same pattern
923 but no earlier patterns), their output order relative to each other is
924 the normal order.
</p>
926 <div class=
"paragraph">
927 <p><orderfile
> is parsed as follows:
</p>
929 <div class=
"openblock">
930 <div class=
"content">
934 <p>Blank lines are ignored, so they can be used as separators for
938 <p>Lines starting with a hash (
"#") are ignored, so they can be used
939 for comments. Add a backslash (
"\") to the beginning of the
940 pattern if it starts with a hash.
</p>
943 <p>Each other line contains a single pattern.
</p>
949 <div class=
"paragraph">
950 <p>Patterns have the same syntax and semantics as patterns used for
951 fnmatch(
3) without the FNM_PATHNAME flag, except a pathname also
952 matches a pattern if removing any number of the final pathname
953 components matches the pattern. For example, the pattern
"<code>foo</code>*bar"
954 matches
"<code>fooasdfbar</code>" and
"<code>foo/bar/baz/asdf</code>" but not
"<code>foobarx</code>".
</p>
957 <dt class=
"hdlist1">--skip-to=
<file
></dt>
958 <dt class=
"hdlist1">--rotate-to=
<file
></dt>
960 <p>Discard the files before the named
<file
> from the output
961 (i.e.
<em>skip to
</em>), or move them to the end of the output
962 (i.e.
<em>rotate to
</em>). These options were invented primarily for the use
963 of the
<code>git
</code> <code>difftool
</code> command, and may not be very useful
966 <dt class=
"hdlist1">--relative[=
<path
>]
</dt>
967 <dt class=
"hdlist1">--no-relative
</dt>
969 <p>When run from a subdirectory of the project, it can be
970 told to exclude changes outside the directory and show
971 pathnames relative to it with this option. When you are
972 not in a subdirectory (e.g. in a bare repository), you
973 can name which subdirectory to make the output relative
974 to by giving a
<path
> as an argument.
975 <code>--no-relative
</code> can be used to countermand both
<code>diff.relative
</code> config
976 option and previous
<code>--relative
</code>.
</p>
978 <dt class=
"hdlist1">-a
</dt>
979 <dt class=
"hdlist1">--text
</dt>
981 <p>Treat all files as text.
</p>
983 <dt class=
"hdlist1">--ignore-cr-at-eol
</dt>
985 <p>Ignore carriage-return at the end of line when doing a comparison.
</p>
987 <dt class=
"hdlist1">--ignore-space-at-eol
</dt>
989 <p>Ignore changes in whitespace at EOL.
</p>
991 <dt class=
"hdlist1">-b
</dt>
992 <dt class=
"hdlist1">--ignore-space-change
</dt>
994 <p>Ignore changes in amount of whitespace. This ignores whitespace
995 at line end, and considers all other sequences of one or
996 more whitespace characters to be equivalent.
</p>
998 <dt class=
"hdlist1">-w
</dt>
999 <dt class=
"hdlist1">--ignore-all-space
</dt>
1001 <p>Ignore whitespace when comparing lines. This ignores
1002 differences even if one line has whitespace where the other
1005 <dt class=
"hdlist1">--ignore-blank-lines
</dt>
1007 <p>Ignore changes whose lines are all blank.
</p>
1009 <dt class=
"hdlist1">-I
<regex
></dt>
1010 <dt class=
"hdlist1">--ignore-matching-lines=
<regex
></dt>
1012 <p>Ignore changes whose all lines match
<regex
>. This option may
1013 be specified more than once.
</p>
1015 <dt class=
"hdlist1">--inter-hunk-context=
<lines
></dt>
1017 <p>Show the context between diff hunks, up to the specified number
1018 of lines, thereby fusing hunks that are close to each other.
1019 Defaults to
<code>diff.interHunkContext
</code> or
0 if the config option
1022 <dt class=
"hdlist1">-W
</dt>
1023 <dt class=
"hdlist1">--function-context
</dt>
1025 <p>Show whole function as context lines for each change.
1026 The function names are determined in the same way as
1027 <code>git
</code> <code>diff
</code> works out patch hunk headers (see
<em>Defining a
1028 custom hunk-header
</em> in
<a href=
"gitattributes.html">gitattributes(
5)
</a>).
</p>
1030 <dt class=
"hdlist1">--ext-diff
</dt>
1032 <p>Allow an external diff helper to be executed. If you set an
1033 external diff driver with
<a href=
"gitattributes.html">gitattributes(
5)
</a>, you need
1034 to use this option with
<a href=
"git-log.html">git-log(
1)
</a> and friends.
</p>
1036 <dt class=
"hdlist1">--no-ext-diff
</dt>
1038 <p>Disallow external diff drivers.
</p>
1040 <dt class=
"hdlist1">--textconv
</dt>
1041 <dt class=
"hdlist1">--no-textconv
</dt>
1043 <p>Allow (or disallow) external text conversion filters to be run
1044 when comparing binary files. See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for
1045 details. Because textconv filters are typically a one-way
1046 conversion, the resulting diff is suitable for human
1047 consumption, but cannot be applied. For this reason, textconv
1048 filters are enabled by default only for
<a href=
"git-diff.html">git-diff(
1)
</a> and
1049 <a href=
"git-log.html">git-log(
1)
</a>, but not for
<a href=
"git-format-patch.html">git-format-patch(
1)
</a> or
1050 diff plumbing commands.
</p>
1052 <dt class=
"hdlist1">--ignore-submodules[=
<when
>]
</dt>
1054 <p>Ignore changes to submodules in the diff generation.
<when
> can be
1055 either
"none",
"untracked",
"dirty" or
"all", which is the default.
1056 Using
"none" will consider the submodule modified when it either contains
1057 untracked or modified files or its HEAD differs from the commit recorded
1058 in the superproject and can be used to override any settings of the
1059 <em>ignore
</em> option in
<a href=
"git-config.html">git-config(
1)
</a> or
<a href=
"gitmodules.html">gitmodules(
5)
</a>. When
1060 "untracked" is used submodules are not considered dirty when they only
1061 contain untracked content (but they are still scanned for modified
1062 content). Using
"dirty" ignores all changes to the work tree of submodules,
1063 only changes to the commits stored in the superproject are shown (this was
1064 the behavior until
1.7.0). Using
"all" hides all changes to submodules.
</p>
1066 <dt class=
"hdlist1">--src-prefix=
<prefix
></dt>
1068 <p>Show the given source prefix instead of
"a/".
</p>
1070 <dt class=
"hdlist1">--dst-prefix=
<prefix
></dt>
1072 <p>Show the given destination prefix instead of
"b/".
</p>
1074 <dt class=
"hdlist1">--no-prefix
</dt>
1076 <p>Do not show any source or destination prefix.
</p>
1078 <dt class=
"hdlist1">--default-prefix
</dt>
1080 <p>Use the default source and destination prefixes (
"a/" and
"b/").
1081 This overrides configuration variables such as
<code>diff.noprefix
</code>,
1082 <code>diff.srcPrefix
</code>,
<code>diff.dstPrefix
</code>, and
<code>diff.mnemonicPrefix
</code>
1083 (see
<code>git-config
</code>(
1)).
</p>
1085 <dt class=
"hdlist1">--line-prefix=
<prefix
></dt>
1087 <p>Prepend an additional prefix to every line of output.
</p>
1089 <dt class=
"hdlist1">--ita-invisible-in-index
</dt>
1091 <p>By default entries added by
"git add -N" appear as an existing
1092 empty file in
"git diff" and a new file in
"git diff --cached".
1093 This option makes the entry appear as a new file in
"git diff"
1094 and non-existent in
"git diff --cached". This option could be
1095 reverted with
<code>--ita-visible-in-index
</code>. Both options are
1096 experimental and could be removed in future.
</p>
1100 <div class=
"paragraph">
1101 <p>For more detailed explanation on these common options, see also
1102 <a href=
"gitdiffcore.html">gitdiffcore(
7)
</a>.
</p>
1106 <dt class=
"hdlist1">-
<n
></dt>
1108 <p>Prepare patches from the topmost
<n
> commits.
</p>
1110 <dt class=
"hdlist1">-o
<dir
></dt>
1111 <dt class=
"hdlist1">--output-directory
<dir
></dt>
1113 <p>Use
<dir
> to store the resulting files, instead of the
1114 current working directory.
</p>
1116 <dt class=
"hdlist1">-n
</dt>
1117 <dt class=
"hdlist1">--numbered
</dt>
1119 <p>Name output in
<em>[PATCH n/m]
</em> format, even with a single patch.
</p>
1121 <dt class=
"hdlist1">-N
</dt>
1122 <dt class=
"hdlist1">--no-numbered
</dt>
1124 <p>Name output in
<em>[PATCH]
</em> format.
</p>
1126 <dt class=
"hdlist1">--start-number
<n
></dt>
1128 <p>Start numbering the patches at
<n
> instead of
1.
</p>
1130 <dt class=
"hdlist1">--numbered-files
</dt>
1132 <p>Output file names will be a simple number sequence
1133 without the default first line of the commit appended.
</p>
1135 <dt class=
"hdlist1">-k
</dt>
1136 <dt class=
"hdlist1">--keep-subject
</dt>
1138 <p>Do not strip/add
<em>[PATCH]
</em> from the first line of the
1139 commit log message.
</p>
1141 <dt class=
"hdlist1">-s
</dt>
1142 <dt class=
"hdlist1">--signoff
</dt>
1144 <p>Add a
<code>Signed-off-by
</code> trailer to the commit message, using
1145 the committer identity of yourself.
1146 See the signoff option in
<a href=
"git-commit.html">git-commit(
1)
</a> for more information.
</p>
1148 <dt class=
"hdlist1">--stdout
</dt>
1150 <p>Print all commits to the standard output in mbox format,
1151 instead of creating a file for each one.
</p>
1153 <dt class=
"hdlist1">--attach[=
<boundary
>]
</dt>
1155 <p>Create multipart/mixed attachment, the first part of
1156 which is the commit message and the patch itself in the
1157 second part, with
<code>Content-Disposition:
</code> <code>attachment
</code>.
</p>
1159 <dt class=
"hdlist1">--no-attach
</dt>
1161 <p>Disable the creation of an attachment, overriding the
1162 configuration setting.
</p>
1164 <dt class=
"hdlist1">--inline[=
<boundary
>]
</dt>
1166 <p>Create multipart/mixed attachment, the first part of
1167 which is the commit message and the patch itself in the
1168 second part, with
<code>Content-Disposition:
</code> <code>inline
</code>.
</p>
1170 <dt class=
"hdlist1">--thread[=
<style
>]
</dt>
1171 <dt class=
"hdlist1">--no-thread
</dt>
1173 <p>Controls addition of
<code>In-Reply-To
</code> and
<code>References
</code> headers to
1174 make the second and subsequent mails appear as replies to the
1175 first. Also controls generation of the
<code>Message-ID
</code> header to
1177 <div class=
"paragraph">
1178 <p>The optional
<style
> argument can be either
<code>shallow
</code> or
<code>deep
</code>.
1179 <em>shallow
</em> threading makes every mail a reply to the head of the
1180 series, where the head is chosen from the cover letter, the
1181 <code>--in-reply-to
</code>, and the first patch mail, in this order.
<em>deep
</em>
1182 threading makes every mail a reply to the previous one.
</p>
1184 <div class=
"paragraph">
1185 <p>The default is
<code>--no-thread
</code>, unless the
<code>format.thread
</code> configuration
1186 is set.
<code>--thread
</code> without an argument is equivalent to
<code>--thread=shallow
</code>.
</p>
1188 <div class=
"paragraph">
1189 <p>Beware that the default for
<em>git send-email
</em> is to thread emails
1190 itself. If you want
<code>git
</code> <code>format-patch
</code> to take care of threading, you
1191 will want to ensure that threading is disabled for
<code>git
</code> <code>send-email
</code>.
</p>
1194 <dt class=
"hdlist1">--in-reply-to=
<message-id
></dt>
1196 <p>Make the first mail (or all the mails with
<code>--no-thread
</code>) appear as a
1197 reply to the given
<message-id
>, which avoids breaking threads to
1198 provide a new patch series.
</p>
1200 <dt class=
"hdlist1">--ignore-if-in-upstream
</dt>
1202 <p>Do not include a patch that matches a commit in
1203 <until
>..
<since
>. This will examine all patches reachable
1204 from
<since
> but not from
<until
> and compare them with the
1205 patches being generated, and any patch that matches is
1208 <dt class=
"hdlist1">--always
</dt>
1210 <p>Include patches for commits that do not introduce any change,
1211 which are omitted by default.
</p>
1213 <dt class=
"hdlist1">--cover-from-description=
<mode
></dt>
1215 <p>Controls which parts of the cover letter will be automatically
1216 populated using the branch
’s description.
</p>
1217 <div class=
"paragraph">
1218 <p>If
<em><mode
></em> is
<code>message
</code> or
<code>default
</code>, the cover letter subject will be
1219 populated with placeholder text. The body of the cover letter will be
1220 populated with the branch
’s description. This is the default mode when
1221 no configuration nor command line option is specified.
</p>
1223 <div class=
"paragraph">
1224 <p>If
<em><mode
></em> is
<code>subject
</code>, the first paragraph of the branch description will
1225 populate the cover letter subject. The remainder of the description will
1226 populate the body of the cover letter.
</p>
1228 <div class=
"paragraph">
1229 <p>If
<em><mode
></em> is
<code>auto
</code>, if the first paragraph of the branch description
1230 is greater than
100 bytes, then the mode will be
<code>message
</code>, otherwise
1231 <code>subject
</code> will be used.
</p>
1233 <div class=
"paragraph">
1234 <p>If
<em><mode
></em> is
<code>none
</code>, both the cover letter subject and body will be
1235 populated with placeholder text.
</p>
1238 <dt class=
"hdlist1">--description-file=
<file
></dt>
1240 <p>Use the contents of
<file
> instead of the branch
’s description
1241 for generating the cover letter.
</p>
1243 <dt class=
"hdlist1">--subject-prefix=
<subject-prefix
></dt>
1245 <p>Instead of the standard
<em>[PATCH]
</em> prefix in the subject
1246 line, instead use
<em>[
<subject-prefix
>]
</em>. This can be used
1247 to name a patch series, and can be combined with the
1248 <code>--numbered
</code> option.
</p>
1249 <div class=
"paragraph">
1250 <p>The configuration variable
<code>format.subjectPrefix
</code> may also be used
1251 to configure a subject prefix to apply to a given repository for
1252 all patches. This is often useful on mailing lists which receive
1253 patches for several repositories and can be used to disambiguate
1254 the patches (with a value of e.g.
"PATCH my-project").
</p>
1257 <dt class=
"hdlist1">--filename-max-length=
<n
></dt>
1259 <p>Instead of the standard
64 bytes, chomp the generated output
1260 filenames at around
<em><n
></em> bytes (too short a value will be
1261 silently raised to a reasonable length). Defaults to the
1262 value of the
<code>format.filenameMaxLength
</code> configuration
1263 variable, or
64 if unconfigured.
</p>
1265 <dt class=
"hdlist1">--rfc[=
<rfc
>]
</dt>
1267 <p>Prepends the string
<em><rfc
></em> (defaults to
"RFC") to
1268 the subject prefix. As the subject prefix defaults to
1269 "PATCH", you
’ll get
"RFC PATCH" by default.
</p>
1270 <div class=
"paragraph">
1271 <p>RFC means
"Request For Comments"; use this when sending
1272 an experimental patch for discussion rather than application.
1273 "--rfc=WIP" may also be a useful way to indicate that a patch
1274 is not complete yet (
"WIP" stands for
"Work In Progress").
</p>
1276 <div class=
"paragraph">
1277 <p>If the convention of the receiving community for a particular extra
1278 string is to have it
<em>after
</em> the subject prefix, the string
<em><rfc
></em>
1279 can be prefixed with a dash (
"<code>-</code>") to signal that the rest of
1280 the
<em><rfc
></em> string should be appended to the subject prefix instead,
1281 e.g.,
<code>--rfc=
</code>'-(
<code>WIP
</code>)' results in
"PATCH (WIP)".
</p>
1284 <dt class=
"hdlist1">-v
<n
></dt>
1285 <dt class=
"hdlist1">--reroll-count=
<n
></dt>
1287 <p>Mark the series as the
<n
>-th iteration of the topic. The
1288 output filenames have
<code>v
</code><em><n
></em> prepended to them, and the
1289 subject prefix (
"PATCH" by default, but configurable via the
1290 <code>--subject-prefix
</code> option) has ` v
<n
>` appended to it. E.g.
1291 <code>--reroll-count=
4</code> may produce
<code>v4-
0001-add-makefile.patch
</code>
1292 file that has
"Subject: [PATCH v4 1/20] Add makefile" in it.
1293 <em><n
></em> does not have to be an integer (e.g.
"--reroll-count=4.4",
1294 or
"--reroll-count=4rev2" are allowed), but the downside of
1295 using such a reroll-count is that the range-diff/interdiff
1296 with the previous version does not state exactly which
1297 version the new iteration is compared against.
</p>
1299 <dt class=
"hdlist1">--to=
<email
></dt>
1301 <p>Add a
<code>To:
</code> header to the email headers. This is in addition
1302 to any configured headers, and may be used multiple times.
1303 The negated form
<code>--no-to
</code> discards all
<code>To:
</code> headers added so
1304 far (from config or command line).
</p>
1306 <dt class=
"hdlist1">--cc=
<email
></dt>
1308 <p>Add a
<code>Cc:
</code> header to the email headers. This is in addition
1309 to any configured headers, and may be used multiple times.
1310 The negated form
<code>--no-cc
</code> discards all
<code>Cc:
</code> headers added so
1311 far (from config or command line).
</p>
1313 <dt class=
"hdlist1">--from
</dt>
1314 <dt class=
"hdlist1">--from=
<ident
></dt>
1316 <p>Use
<code>ident
</code> in the
<code>From:
</code> header of each commit email. If the
1317 author ident of the commit is not textually identical to the
1318 provided
<code>ident
</code>, place a
<code>From:
</code> header in the body of the
1319 message with the original author. If no
<code>ident
</code> is given, use
1320 the committer ident.
</p>
1321 <div class=
"paragraph">
1322 <p>Note that this option is only useful if you are actually sending the
1323 emails and want to identify yourself as the sender, but retain the
1324 original author (and
<code>git
</code> <code>am
</code> will correctly pick up the in-body
1325 header). Note also that
<code>git
</code> <code>send-email
</code> already handles this
1326 transformation for you, and this option should not be used if you are
1327 feeding the result to
<code>git
</code> <code>send-email
</code>.
</p>
1330 <dt class=
"hdlist1">--[no-]force-in-body-from
</dt>
1332 <p>With the e-mail sender specified via the
<code>--from
</code> option, by
1333 default, an in-body
"From:" to identify the real author of
1334 the commit is added at the top of the commit log message if
1335 the sender is different from the author. With this option,
1336 the in-body
"From:" is added even when the sender and the
1337 author have the same name and address, which may help if the
1338 mailing list software mangles the sender
’s identity.
1339 Defaults to the value of the
<code>format.forceInBodyFrom
</code>
1340 configuration variable.
</p>
1342 <dt class=
"hdlist1">--add-header=
<header
></dt>
1344 <p>Add an arbitrary header to the email headers. This is in addition
1345 to any configured headers, and may be used multiple times.
1346 For example,
<code>--add-header=
</code>"Organization: <code>git-foo</code>".
1347 The negated form
<code>--no-add-header
</code> discards
<strong>all
</strong> (
<code>To:
</code>,
1348 <code>Cc:
</code>, and custom) headers added so far from config or command
1351 <dt class=
"hdlist1">--[no-]cover-letter
</dt>
1353 <p>In addition to the patches, generate a cover letter file
1354 containing the branch description, shortlog and the overall diffstat. You can
1355 fill in a description in the file before sending it out.
</p>
1357 <dt class=
"hdlist1">--encode-email-headers
</dt>
1358 <dt class=
"hdlist1">--no-encode-email-headers
</dt>
1360 <p>Encode email headers that have non-ASCII characters with
1361 "Q-encoding" (described in RFC
2047), instead of outputting the
1362 headers verbatim. Defaults to the value of the
1363 <code>format.encodeEmailHeaders
</code> configuration variable.
</p>
1365 <dt class=
"hdlist1">--interdiff=
<previous
></dt>
1367 <p>As a reviewer aid, insert an interdiff into the cover letter,
1368 or as commentary of the lone patch of a
1-patch series, showing
1369 the differences between the previous version of the patch series and
1370 the series currently being formatted.
<code>previous
</code> is a single revision
1371 naming the tip of the previous series which shares a common base with
1372 the series being formatted (for example
<code>git
</code> <code>format-patch
</code>
1373 <code>--cover-letter
</code> <code>--interdiff=feature/v1
</code> <code>-
3</code> <code>feature/v2
</code>).
</p>
1375 <dt class=
"hdlist1">--range-diff=
<previous
></dt>
1377 <p>As a reviewer aid, insert a range-diff (see
<a href=
"git-range-diff.html">git-range-diff(
1)
</a>)
1378 into the cover letter, or as commentary of the lone patch of a
1379 1-patch series, showing the differences between the previous
1380 version of the patch series and the series currently being formatted.
1381 <code>previous
</code> can be a single revision naming the tip of the previous
1382 series if it shares a common base with the series being formatted (for
1383 example
<code>git
</code> <code>format-patch
</code> <code>--cover-letter
</code> <code>--range-diff=feature/v1
</code> <code>-
3</code>
1384 <code>feature/v2
</code>), or a revision range if the two versions of the series are
1385 disjoint (for example
<code>git
</code> <code>format-patch
</code> <code>--cover-letter
</code>
1386 <code>--range-diff=feature/v1~
3</code><code>..
</code><code>feature/v1
</code> <code>-
3</code> <code>feature/v2
</code>).
</p>
1387 <div class=
"paragraph">
1388 <p>Note that diff options passed to the command affect how the primary
1389 product of
<code>format-patch
</code> is generated, and they are not passed to
1390 the underlying
<code>range-diff
</code> machinery used to generate the cover-letter
1391 material (this may change in the future).
</p>
1394 <dt class=
"hdlist1">--creation-factor=
<percent
></dt>
1396 <p>Used with
<code>--range-diff
</code>, tweak the heuristic which matches up commits
1397 between the previous and current series of patches by adjusting the
1398 creation/deletion cost fudge factor. See
<a href=
"git-range-diff.html">git-range-diff(
1)
</a>)
1400 <div class=
"paragraph">
1401 <p>Defaults to
999 (the
<a href=
"git-range-diff.html">git-range-diff(
1)
</a> uses
60), as the use
1402 case is to show comparison with an older iteration of the same
1403 topic and the tool should find more correspondence between the two
1404 sets of patches.
</p>
1407 <dt class=
"hdlist1">--notes[=
<ref
>]
</dt>
1408 <dt class=
"hdlist1">--no-notes
</dt>
1410 <p>Append the notes (see
<a href=
"git-notes.html">git-notes(
1)
</a>) for the commit
1411 after the three-dash line.
</p>
1412 <div class=
"paragraph">
1413 <p>The expected use case of this is to write supporting explanation for
1414 the commit that does not belong to the commit log message proper,
1415 and include it with the patch submission. While one can simply write
1416 these explanations after
<code>format-patch
</code> has run but before sending,
1417 keeping them as Git notes allows them to be maintained between versions
1418 of the patch series (but see the discussion of the
<code>notes.rewrite
</code>
1419 configuration options in
<a href=
"git-notes.html">git-notes(
1)
</a> to use this workflow).
</p>
1421 <div class=
"paragraph">
1422 <p>The default is
<code>--no-notes
</code>, unless the
<code>format.notes
</code> configuration is
1426 <dt class=
"hdlist1">--[no-]signature=
<signature
></dt>
1428 <p>Add a signature to each message produced. Per RFC
3676 the signature
1429 is separated from the body by a line with '-- ' on it. If the
1430 signature option is omitted the signature defaults to the Git version
1433 <dt class=
"hdlist1">--signature-file=
<file
></dt>
1435 <p>Works just like --signature except the signature is read from a file.
</p>
1437 <dt class=
"hdlist1">--suffix=.
<sfx
></dt>
1439 <p>Instead of using .
<code>patch
</code> as the suffix for generated
1440 filenames, use specified suffix. A common alternative is
1441 <code>--suffix=.txt
</code>. Leaving this empty will remove the .
<code>patch
</code>
1443 <div class=
"paragraph">
1444 <p>Note that the leading character does not have to be a dot; for example,
1445 you can use
<code>--suffix=-patch
</code> to get
<code>0001-description-of-my-change-patch
</code>.
</p>
1448 <dt class=
"hdlist1">-q
</dt>
1449 <dt class=
"hdlist1">--quiet
</dt>
1451 <p>Do not print the names of the generated files to standard output.
</p>
1453 <dt class=
"hdlist1">--no-binary
</dt>
1455 <p>Do not output contents of changes in binary files, instead
1456 display a notice that those files changed. Patches generated
1457 using this option cannot be applied properly, but they are
1458 still useful for code review.
</p>
1460 <dt class=
"hdlist1">--zero-commit
</dt>
1462 <p>Output an all-zero hash in each patch
’s From header instead
1463 of the hash of the commit.
</p>
1465 <dt class=
"hdlist1">--[no-]base[=
<commit
>]
</dt>
1467 <p>Record the base tree information to identify the state the
1468 patch series applies to. See the BASE TREE INFORMATION section
1469 below for details. If
<commit
> is
"auto", a base commit is
1470 automatically chosen. The
<code>--no-base
</code> option overrides a
1471 <code>format.useAutoBase
</code> configuration.
</p>
1473 <dt class=
"hdlist1">--root
</dt>
1475 <p>Treat the revision argument as a
<revision-range
>, even if it
1476 is just a single commit (that would normally be treated as a
1477 <since
>). Note that root commits included in the specified
1478 range are always formatted as creation patches, independently
1481 <dt class=
"hdlist1">--progress
</dt>
1483 <p>Show progress reports on stderr as patches are generated.
</p>
1490 <h2 id=
"_configuration">CONFIGURATION
</h2>
1491 <div class=
"sectionbody">
1492 <div class=
"paragraph">
1493 <p>You can specify extra mail header lines to be added to each message,
1494 defaults for the subject prefix and file suffix, number patches when
1495 outputting more than one patch, add
"To:" or
"Cc:" headers, configure
1496 attachments, change the patch output directory, and sign off patches
1497 with configuration variables.
</p>
1499 <div class=
"listingblock">
1500 <div class=
"content">
1502 headers =
"Organization: git-foo\n"
1503 subjectPrefix = CHANGE
1508 attach [ = mime-boundary-string ]
1510 outputDirectory =
<directory
>
1512 coverFromDescription = auto
</pre>
1518 <h2 id=
"_discussion">DISCUSSION
</h2>
1519 <div class=
"sectionbody">
1520 <div class=
"paragraph">
1521 <p>The patch produced by
<em>git format-patch
</em> is in UNIX mailbox format,
1522 with a fixed
"magic" time stamp to indicate that the file is output
1523 from format-patch rather than a real mailbox, like so:
</p>
1525 <div class=
"listingblock">
1526 <div class=
"content">
1527 <pre>From
8f72bad1baf19a53459661343e21d6491c3908d3 Mon Sep
17 00:
00:
00 2001
1528 From: Tony Luck
<tony.luck@intel.com
>
1529 Date: Tue,
13 Jul
2010 11:
42:
54 -
0700
1530 Subject: [PATCH] =?UTF-
8?q?[IA64]=
20Put=
20ia64=
20config=
20files=
20on=
20the=
20?=
1531 =?UTF-
8?q?Uwe=
20Kleine-K=C3=B6nig=
20diet?=
1533 Content-Type: text/plain; charset=UTF-
8
1534 Content-Transfer-Encoding:
8bit
1536 arch/arm config files were slimmed down using a python script
1537 (See commit c2330e286f68f1c408b4aa6515ba49d57f05beae comment)
1539 Do the same for ia64 so we can have sleek
& trim looking
1543 <div class=
"paragraph">
1544 <p>Typically it will be placed in a MUA
’s drafts folder, edited to add
1545 timely commentary that should not go in the changelog after the three
1546 dashes, and then sent as a message whose body, in our example, starts
1547 with
"arch/arm config files were…​". On the receiving end, readers
1548 can save interesting patches in a UNIX mailbox and apply them with
1549 <a href=
"git-am.html">git-am(
1)
</a>.
</p>
1551 <div class=
"paragraph">
1552 <p>When a patch is part of an ongoing discussion, the patch generated by
1553 <em>git format-patch
</em> can be tweaked to take advantage of the
<em>git am
1554 --scissors
</em> feature. After your response to the discussion comes a
1555 line that consists solely of
"<code>--</code> ><code>8</code> <code>--</code>" (scissors and perforation),
1556 followed by the patch with unnecessary header fields removed:
</p>
1558 <div class=
"listingblock">
1559 <div class=
"content">
1561 > So we should do such-and-such.
1563 Makes sense to me. How about this patch?
1566 Subject: [IA64] Put ia64 config files on the Uwe Kleine-König diet
1568 arch/arm config files were slimmed down using a python script
1572 <div class=
"paragraph">
1573 <p>When sending a patch this way, most often you are sending your own
1574 patch, so in addition to the
"<code>From</code> <code>$SHA1</code> <code>$magic_timestamp</code>" marker you
1575 should omit
<code>From:
</code> and
<code>Date:
</code> lines from the patch file. The patch
1576 title is likely to be different from the subject of the discussion the
1577 patch is in response to, so it is likely that you would want to keep
1578 the Subject: line, like the example above.
</p>
1581 <h3 id=
"_checking_for_patch_corruption">Checking for patch corruption
</h3>
1582 <div class=
"paragraph">
1583 <p>Many mailers if not set up properly will corrupt whitespace. Here are
1584 two common types of corruption:
</p>
1589 <p>Empty context lines that do not have
<em>any
</em> whitespace.
</p>
1592 <p>Non-empty context lines that have one extra whitespace at the
1597 <div class=
"paragraph">
1598 <p>One way to test if your MUA is set up correctly is:
</p>
1603 <p>Send the patch to yourself, exactly the way you would, except
1604 with To: and Cc: lines that do not contain the list and
1605 maintainer address.
</p>
1608 <p>Save that patch to a file in UNIX mailbox format. Call it a.patch,
1613 <div class=
"literalblock">
1614 <div class=
"content">
1615 <pre>$ git fetch
<project
> master:test-apply
1616 $ git switch test-apply
1617 $ git restore --source=HEAD --staged --worktree :/
1618 $ git am a.patch
</pre>
1624 <div class=
"paragraph">
1625 <p>If it does not apply correctly, there can be various reasons.
</p>
1630 <p>The patch itself does not apply cleanly. That is
<em>bad
</em> but
1631 does not have much to do with your MUA. You might want to rebase
1632 the patch with
<a href=
"git-rebase.html">git-rebase(
1)
</a> before regenerating it in
1636 <p>The MUA corrupted your patch;
"am" would complain that
1637 the patch does not apply. Look in the .git/rebase-apply/ subdirectory and
1638 see what
<em>patch
</em> file contains and check for the common
1639 corruption patterns mentioned above.
</p>
1642 <p>While at it, check the
<em>info
</em> and
<em>final-commit
</em> files as well.
1643 If what is in
<em>final-commit
</em> is not exactly what you would want to
1644 see in the commit log message, it is very likely that the
1645 receiver would end up hand editing the log message when applying
1646 your patch. Things like
"Hi, this is my first patch.\n" in the
1647 patch e-mail should come after the three-dash line that signals
1648 the end of the commit message.
</p>
1656 <h2 id=
"_mua_specific_hints">MUA-SPECIFIC HINTS
</h2>
1657 <div class=
"sectionbody">
1658 <div class=
"paragraph">
1659 <p>Here are some hints on how to successfully submit patches inline using
1660 various mailers.
</p>
1663 <h3 id=
"_gmail">GMail
</h3>
1664 <div class=
"paragraph">
1665 <p>GMail does not have any way to turn off line wrapping in the web
1666 interface, so it will mangle any emails that you send. You can however
1667 use
"git send-email" and send your patches through the GMail SMTP server, or
1668 use any IMAP email client to connect to the google IMAP server and forward
1669 the emails through that.
</p>
1671 <div class=
"paragraph">
1672 <p>For hints on using
<em>git send-email
</em> to send your patches through the
1673 GMail SMTP server, see the EXAMPLE section of
<a href=
"git-send-email.html">git-send-email(
1)
</a>.
</p>
1675 <div class=
"paragraph">
1676 <p>For hints on submission using the IMAP interface, see the EXAMPLE
1677 section of
<a href=
"git-imap-send.html">git-imap-send(
1)
</a>.
</p>
1681 <h3 id=
"_thunderbird">Thunderbird
</h3>
1682 <div class=
"paragraph">
1683 <p>By default, Thunderbird will both wrap emails as well as flag
1684 them as being
<em>format=flowed
</em>, both of which will make the
1685 resulting email unusable by Git.
</p>
1687 <div class=
"paragraph">
1688 <p>There are three different approaches: use an add-on to turn off line wraps,
1689 configure Thunderbird to not mangle patches, or use
1690 an external editor to keep Thunderbird from mangling the patches.
</p>
1693 <h4 id=
"_approach_1_add_on">Approach #
1 (add-on)
</h4>
1694 <div class=
"paragraph">
1695 <p>Install the Toggle Word Wrap add-on that is available from
1696 <a href=
"https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/" class=
"bare">https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/
</a>
1697 It adds a menu entry
"Enable Word Wrap" in the composer
’s
"Options" menu
1698 that you can tick off. Now you can compose the message as you otherwise do
1699 (cut + paste,
<em>git format-patch
</em> |
<em>git imap-send
</em>, etc), but you have to
1700 insert line breaks manually in any text that you type.
</p>
1704 <h4 id=
"_approach_2_configuration">Approach #
2 (configuration)
</h4>
1705 <div class=
"paragraph">
1708 <div class=
"olist arabic">
1711 <p>Configure your mail server composition as plain text:
1712 Edit
…​Account Settings
…​Composition
& Addressing,
1713 uncheck
"Compose Messages in HTML".
</p>
1716 <p>Configure your general composition window to not wrap.
</p>
1717 <div class=
"paragraph">
1718 <p>In Thunderbird
2:
1719 Edit..Preferences..Composition, wrap plain text messages at
0</p>
1721 <div class=
"paragraph">
1722 <p>In Thunderbird
3:
1723 Edit..Preferences..Advanced..Config Editor. Search for
1724 "mail.wrap_long_lines".
1725 Toggle it to make sure it is set to
<code>false
</code>. Also, search for
1726 "mailnews.wraplength" and set the value to
0.
</p>
1730 <p>Disable the use of format=flowed:
1731 Edit..Preferences..Advanced..Config Editor. Search for
1732 "mailnews.send_plaintext_flowed".
1733 Toggle it to make sure it is set to
<code>false
</code>.
</p>
1737 <div class=
"paragraph">
1738 <p>After that is done, you should be able to compose email as you
1739 otherwise would (cut + paste,
<em>git format-patch
</em> |
<em>git imap-send
</em>, etc),
1740 and the patches will not be mangled.
</p>
1744 <h4 id=
"_approach_3_external_editor">Approach #
3 (external editor)
</h4>
1745 <div class=
"paragraph">
1746 <p>The following Thunderbird extensions are needed:
1747 AboutConfig from
<a href=
"https://mjg.github.io/AboutConfig/" class=
"bare">https://mjg.github.io/AboutConfig/
</a> and
1748 External Editor from
<a href=
"https://globs.org/articles.php?lng=en&pg=8" class=
"bare">https://globs.org/articles.php?lng=en
&pg=
8</a></p>
1750 <div class=
"olist arabic">
1753 <p>Prepare the patch as a text file using your method of choice.
</p>
1756 <p>Before opening a compose window, use Edit
→Account Settings to
1757 uncheck the
"Compose messages in HTML format" setting in the
1758 "Composition & Addressing" panel of the account to be used to
1762 <p>In the main Thunderbird window,
<em>before
</em> you open the compose
1763 window for the patch, use Tools
→about:config to set the
1764 following to the indicated values:
</p>
1765 <div class=
"listingblock">
1766 <div class=
"content">
1767 <pre> mailnews.send_plaintext_flowed =
> false
1768 mailnews.wraplength =
> 0</pre>
1773 <p>Open a compose window and click the external editor icon.
</p>
1776 <p>In the external editor window, read in the patch file and exit
1777 the editor normally.
</p>
1781 <div class=
"paragraph">
1782 <p>Side note: it may be possible to do step
2 with
1783 about:config and the following settings but no one
’s tried yet.
</p>
1785 <div class=
"listingblock">
1786 <div class=
"content">
1787 <pre> mail.html_compose =
> false
1788 mail.identity.default.compose_html =
> false
1789 mail.identity.id?.compose_html =
> false
</pre>
1792 <div class=
"paragraph">
1793 <p>There is a script in contrib/thunderbird-patch-inline which can help
1794 you include patches with Thunderbird in an easy way. To use it, do the
1795 steps above and then use the script as the external editor.
</p>
1800 <h3 id=
"_kmail">KMail
</h3>
1801 <div class=
"paragraph">
1802 <p>This should help you to submit patches inline using KMail.
</p>
1804 <div class=
"olist arabic">
1807 <p>Prepare the patch as a text file.
</p>
1810 <p>Click on New Mail.
</p>
1813 <p>Go under
"Options" in the Composer window and be sure that
1814 "Word wrap" is not set.
</p>
1817 <p>Use Message
→ Insert file
…​ and insert the patch.
</p>
1820 <p>Back in the compose window: add whatever other text you wish to the
1821 message, complete the addressing and subject fields, and press send.
</p>
1829 <h2 id=
"_base_tree_information">BASE TREE INFORMATION
</h2>
1830 <div class=
"sectionbody">
1831 <div class=
"paragraph">
1832 <p>The base tree information block is used for maintainers or third party
1833 testers to know the exact state the patch series applies to. It consists
1834 of the
<em>base commit
</em>, which is a well-known commit that is part of the
1835 stable part of the project history everybody else works off of, and zero
1836 or more
<em>prerequisite patches
</em>, which are well-known patches in flight
1837 that is not yet part of the
<em>base commit
</em> that need to be applied on top
1838 of
<em>base commit
</em> in topological order before the patches can be applied.
</p>
1840 <div class=
"paragraph">
1841 <p>The
<em>base commit
</em> is shown as
"base-commit: " followed by the
40-hex of
1842 the commit object name. A
<em>prerequisite patch
</em> is shown as
1843 "prerequisite-patch-id: " followed by the
40-hex
<em>patch id
</em>, which can
1844 be obtained by passing the patch through the
<code>git
</code> <code>patch-id
</code> <code>--stable
</code>
1847 <div class=
"paragraph">
1848 <p>Imagine that on top of the public commit P, you applied well-known
1849 patches X, Y and Z from somebody else, and then built your three-patch
1850 series A, B, C, the history would be like:
</p>
1852 <div class=
"literalblock">
1853 <div class=
"content">
1854 <pre>---P---X---Y---Z---A---B---C
</pre>
1857 <div class=
"paragraph">
1858 <p>With
<code>git
</code> <code>format-patch
</code> <code>--base=P
</code> <code>-
3</code> <code>C
</code> (or variants thereof, e.g. with
1859 <code>--cover-letter
</code> or using
<code>Z
</code><code>..
</code><code>C
</code> instead of
<code>-
3</code> <code>C
</code> to specify the
1860 range), the base tree information block is shown at the end of the
1861 first message the command outputs (either the first patch, or the
1862 cover letter), like this:
</p>
1864 <div class=
"listingblock">
1865 <div class=
"content">
1867 prerequisite-patch-id: X
1868 prerequisite-patch-id: Y
1869 prerequisite-patch-id: Z
</pre>
1872 <div class=
"paragraph">
1873 <p>For non-linear topology, such as
</p>
1875 <div class=
"literalblock">
1876 <div class=
"content">
1877 <pre>---P---X---A---M---C
1882 <div class=
"paragraph">
1883 <p>You can also use
<code>git
</code> <code>format-patch
</code> <code>--base=P
</code> <code>-
3</code> <code>C
</code> to generate patches
1884 for A, B and C, and the identifiers for P, X, Y, Z are appended at the
1885 end of the first message.
</p>
1887 <div class=
"paragraph">
1888 <p>If set
<code>--base=auto
</code> in cmdline, it will automatically compute
1889 the base commit as the merge base of tip commit of the remote-tracking
1890 branch and revision-range specified in cmdline.
1891 For a local branch, you need to make it to track a remote branch by
<code>git
</code> <code>branch
</code>
1892 <code>--set-upstream-to
</code> before using this option.
</p>
1897 <h2 id=
"_examples">EXAMPLES
</h2>
1898 <div class=
"sectionbody">
1902 <p>Extract commits between revisions R1 and R2, and apply them on top of
1903 the current branch using
<em>git am
</em> to cherry-pick them:
</p>
1904 <div class=
"listingblock">
1905 <div class=
"content">
1906 <pre>$ git format-patch -k --stdout R1..R2 | git am -
3 -k
</pre>
1911 <p>Extract all commits which are in the current branch but not in the
1913 <div class=
"listingblock">
1914 <div class=
"content">
1915 <pre>$ git format-patch origin
</pre>
1918 <div class=
"paragraph">
1919 <p>For each commit a separate file is created in the current directory.
</p>
1923 <p>Extract all commits that lead to
<em>origin
</em> since the inception of the
1925 <div class=
"listingblock">
1926 <div class=
"content">
1927 <pre>$ git format-patch --root origin
</pre>
1932 <p>The same as the previous one:
</p>
1933 <div class=
"listingblock">
1934 <div class=
"content">
1935 <pre>$ git format-patch -M -B origin
</pre>
1938 <div class=
"paragraph">
1939 <p>Additionally, it detects and handles renames and complete rewrites
1940 intelligently to produce a renaming patch. A renaming patch reduces
1941 the amount of text output, and generally makes it easier to review.
1942 Note that non-Git
"patch" programs won
’t understand renaming patches, so
1943 use it only when you know the recipient uses Git to apply your patch.
</p>
1947 <p>Extract three topmost commits from the current branch and format them
1948 as e-mailable patches:
</p>
1949 <div class=
"listingblock">
1950 <div class=
"content">
1951 <pre>$ git format-patch -
3</pre>
1960 <h2 id=
"_caveats">CAVEATS
</h2>
1961 <div class=
"sectionbody">
1962 <div class=
"paragraph">
1963 <p>Note that
<code>format-patch
</code> will omit merge commits from the output, even
1964 if they are part of the requested range. A simple
"patch" does not
1965 include enough information for the receiving end to reproduce the same
1971 <h2 id=
"_see_also">SEE ALSO
</h2>
1972 <div class=
"sectionbody">
1973 <div class=
"paragraph">
1974 <p><a href=
"git-am.html">git-am(
1)
</a>,
<a href=
"git-send-email.html">git-send-email(
1)
</a></p>
1979 <h2 id=
"_git">GIT
</h2>
1980 <div class=
"sectionbody">
1981 <div class=
"paragraph">
1982 <p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p>
1988 <div id=
"footer-text">
1989 Last updated
2024-
11-
01 22:
46:
55 -
0700