blob: a2f8a3db68b5096137487b49a0884a4ef3f70573 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-format-patch(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-format-patch(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-format-patch -
Junio C Hamano01078922006-03-10 00:31:47317 Prepare patches for e-mail submission
Junio C Hamano1a4e8412005-12-27 08:17:23318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58323<div class="verseblock">
Junio C Hamanof4581102009-04-25 08:29:59324<div class="content"><em>git format-patch</em> [-k] [(-o|--output-directory) &lt;dir&gt; | --stdout]
Junio C Hamano1bbd0f42009-07-23 06:20:29325 [--no-thread | --thread[=&lt;style&gt;]]
Junio C Hamanof4581102009-04-25 08:29:59326 [(--attach|--inline)[=&lt;boundary&gt;] | --no-attach]
327 [-s | --signoff]
Junio C Hamano89a57342010-06-22 23:22:55328 [--signature=&lt;signature&gt; | --no-signature]
Junio C Hamano8c5802d2007-11-15 00:13:36329 [-n | --numbered | -N | --no-numbered]
Junio C Hamano94cad1a2007-06-06 10:48:25330 [--start-number &lt;n&gt;] [--numbered-files]
Junio C Hamano4f9a6052007-01-17 20:25:16331 [--in-reply-to=Message-Id] [--suffix=.&lt;sfx&gt;]
Junio C Hamano7c73c662007-01-19 00:37:50332 [--ignore-if-in-upstream]
Junio C Hamano6f1cca82007-04-12 05:02:47333 [--subject-prefix=Subject-Prefix]
Junio C Hamanoea90ab32010-03-15 20:32:55334 [--to=&lt;email&gt;] [--cc=&lt;email&gt;]
Junio C Hamano24bc09a2008-02-28 00:27:44335 [--cover-letter]
Junio C Hamanof4581102009-04-25 08:29:59336 [&lt;common diff options&gt;]
Junio C Hamano7d9e9bd2007-08-29 07:31:47337 [ &lt;since&gt; | &lt;revision range&gt; ]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23338</div>
Junio C Hamanoba4b9282008-07-06 05:20:31339<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23340<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31341<div class="para"><p>Prepare each commit with its patch in
Junio C Hamano341071d2006-06-04 07:24:48342one file per commit, formatted to resemble UNIX mailbox format.
Junio C Hamano7d9e9bd2007-08-29 07:31:47343The output of this command is convenient for e-mail submission or
Junio C Hamano1aa40d22010-01-21 17:46:43344for use with <em>git am</em>.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:31345<div class="para"><p>There are two ways to specify which commits to operate on.</p></div>
346<div class="olist"><ol>
Junio C Hamano7d9e9bd2007-08-29 07:31:47347<li>
348<p>
349A single commit, &lt;since&gt;, specifies that the commits leading
350 to the tip of the current branch that are not in the history
351 that leads to the &lt;since&gt; to be output.
352</p>
353</li>
354<li>
355<p>
356Generic &lt;revision range&gt; expression (see "SPECIFYING
Junio C Hamano78e3a782010-07-15 22:24:45357 REVISIONS" section in <a href="gitrevisions.html">gitrevisions(1)</a>) means the
Junio C Hamano7d9e9bd2007-08-29 07:31:47358 commits in the specified range.
359</p>
360</li>
Junio C Hamanoba4b9282008-07-06 05:20:31361</ol></div>
Junio C Hamano9572e922009-04-02 06:52:03362<div class="para"><p>The first rule takes precedence in the case of a single &lt;commit&gt;. To
363apply the second rule, i.e., format everything since the beginning of
Junio C Hamano3b70d3c2009-11-21 17:37:37364history up until &lt;commit&gt;, use the <em>--root</em> option: <tt>git format-patch
365--root &lt;commit&gt;</tt>. If you want to format only &lt;commit&gt; itself, you
366can do this with <tt>git format-patch -1 &lt;commit&gt;</tt>.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:31367<div class="para"><p>By default, each output file is numbered sequentially from 1, and uses the
Junio C Hamano341071d2006-06-04 07:24:48368first line of the commit message (massaged for pathname safety) as
Junio C Hamano3b70d3c2009-11-21 17:37:37369the filename. With the <tt>--numbered-files</tt> option, the output file names
Junio C Hamano94cad1a2007-06-06 10:48:25370will only be numbers, without the first line of the commit appended.
371The names of the output files are printed to standard
Junio C Hamano3b70d3c2009-11-21 17:37:37372output, unless the <tt>--stdout</tt> option is specified.</p></div>
373<div class="para"><p>If <tt>-o</tt> is specified, output files are created in &lt;dir&gt;. Otherwise
Junio C Hamanoba4b9282008-07-06 05:20:31374they are created in the current working directory.</p></div>
Junio C Hamano7d06a8a2008-10-20 05:42:33375<div class="para"><p>By default, the subject of a single patch is "[PATCH] First Line" and
376the subject when multiple patches are output is "[PATCH n/m] First
Junio C Hamano3b70d3c2009-11-21 17:37:37377Line". To force 1/1 to be added for a single patch, use <tt>-n</tt>. To omit
378patch numbers from the subject, use <tt>-N</tt>.</p></div>
379<div class="para"><p>If given <tt>--thread</tt>, <tt>git-format-patch</tt> will generate <tt>In-Reply-To</tt> and
380<tt>References</tt> headers to make the second and subsequent patch mails appear
381as replies to the first mail; this also generates a <tt>Message-Id</tt> header to
Junio C Hamanoba4b9282008-07-06 05:20:31382reference.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23383</div>
Junio C Hamanoba4b9282008-07-06 05:20:31384<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23385<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31386<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23387<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26388-p
389</dt>
Junio C Hamano3b70d3c2009-11-21 17:37:37390<dt>
391--no-stat
392</dt>
Junio C Hamano60f8aa82007-03-06 09:58:26393<dd>
394<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37395 Generate plain patches without any diffstats.
Junio C Hamano60f8aa82007-03-06 09:58:26396</p>
397</dd>
398<dt>
Junio C Hamano69361562007-07-26 02:14:34399-U&lt;n&gt;
400</dt>
Junio C Hamano69361562007-07-26 02:14:34401<dt>
402--unified=&lt;n&gt;
403</dt>
404<dd>
405<p>
406 Generate diffs with &lt;n&gt; lines of context instead of
Junio C Hamano3b70d3c2009-11-21 17:37:37407 the usual three.
Junio C Hamano60f8aa82007-03-06 09:58:26408</p>
409</dd>
Junio C Hamano20d47e32009-01-26 06:36:02410<dt>
411--patience
412</dt>
413<dd>
414<p>
415 Generate a diff using the "patience diff" algorithm.
416</p>
417</dd>
Junio C Hamano60f8aa82007-03-06 09:58:26418<dt>
419--stat[=width[,name-width]]
420</dt>
421<dd>
422<p>
423 Generate a diffstat. You can override the default
Junio C Hamano3b70d3c2009-11-21 17:37:37424 output width for 80-column terminal by <tt>--stat=width</tt>.
Junio C Hamano60f8aa82007-03-06 09:58:26425 The width of the filename part can be controlled by
426 giving another width to it separated by a comma.
427</p>
428</dd>
429<dt>
430--numstat
431</dt>
432<dd>
433<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37434 Similar to <tt>--stat</tt>, but shows number of added and
Junio C Hamano60f8aa82007-03-06 09:58:26435 deleted lines in decimal notation and pathname without
436 abbreviation, to make it more machine friendly. For
437 binary files, outputs two <tt>-</tt> instead of saying
438 <tt>0 0</tt>.
439</p>
440</dd>
441<dt>
442--shortstat
443</dt>
444<dd>
445<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37446 Output only the last line of the <tt>--stat</tt> format containing total
Junio C Hamano60f8aa82007-03-06 09:58:26447 number of modified files, as well as number of added and deleted
448 lines.
449</p>
450</dd>
451<dt>
Junio C Hamano6a45be92008-04-22 08:19:03452--dirstat[=limit]
453</dt>
454<dd>
455<p>
Junio C Hamanoa2f46622008-09-03 05:20:31456 Output the distribution of relative amount of changes (number of lines added or
457 removed) for each sub-directory. Directories with changes below
458 a cut-off percent (3% by default) are not shown. The cut-off percent
Junio C Hamano3b70d3c2009-11-21 17:37:37459 can be set with <tt>--dirstat=limit</tt>. Changes in a child directory is not
460 counted for the parent directory, unless <tt>--cumulative</tt> is used.
Junio C Hamano6a45be92008-04-22 08:19:03461</p>
462</dd>
463<dt>
Junio C Hamanoa476efa2008-10-10 15:31:42464--dirstat-by-file[=limit]
465</dt>
466<dd>
467<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37468 Same as <tt>--dirstat</tt>, but counts changed files instead of lines.
Junio C Hamanoa476efa2008-10-10 15:31:42469</p>
470</dd>
471<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26472--summary
473</dt>
474<dd>
475<p>
476 Output a condensed summary of extended header information
477 such as creations, renames and mode changes.
478</p>
479</dd>
480<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26481--no-renames
482</dt>
483<dd>
484<p>
485 Turn off rename detection, even when the configuration
486 file gives the default to do so.
487</p>
488</dd>
489<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26490--full-index
491</dt>
492<dd>
493<p>
Junio C Hamano5cf43ca2008-08-20 09:14:14494 Instead of the first handful of characters, show the full
495 pre- and post-image blob object names on the "index"
496 line when generating patch format output.
Junio C Hamano60f8aa82007-03-06 09:58:26497</p>
498</dd>
499<dt>
500--binary
501</dt>
502<dd>
503<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37504 In addition to <tt>--full-index</tt>, output a binary diff that
505 can be applied with <tt>git-apply</tt>.
Junio C Hamano60f8aa82007-03-06 09:58:26506</p>
507</dd>
508<dt>
509--abbrev[=&lt;n&gt;]
510</dt>
511<dd>
512<p>
513 Instead of showing the full 40-byte hexadecimal object
514 name in diff-raw format output and diff-tree header
Junio C Hamano6efe3022009-01-13 16:47:56515 lines, show only a partial prefix. This is
Junio C Hamano3b70d3c2009-11-21 17:37:37516 independent of the <tt>--full-index</tt> option above, which controls
Junio C Hamano60f8aa82007-03-06 09:58:26517 the diff-patch output format. Non default number of
Junio C Hamano3b70d3c2009-11-21 17:37:37518 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
Junio C Hamano60f8aa82007-03-06 09:58:26519</p>
520</dd>
521<dt>
Junio C Hamanoe85e36f2010-08-10 05:30:14522-B[&lt;n&gt;][/&lt;m&gt;]
Junio C Hamano60f8aa82007-03-06 09:58:26523</dt>
524<dd>
525<p>
Junio C Hamanoe85e36f2010-08-10 05:30:14526 Break complete rewrite changes into pairs of delete and
527 create. This serves two purposes:
Junio C Hamano60f8aa82007-03-06 09:58:26528</p>
Junio C Hamanoe85e36f2010-08-10 05:30:14529<div class="para"><p>It affects the way a change that amounts to a total rewrite of a file
530not as a series of deletion and insertion mixed together with a very
531few lines that happen to match textually as the context, but as a
532single deletion of everything old followed by a single insertion of
533everything new, and the number <tt>m</tt> controls this aspect of the -B
534option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
535original should remain in the result for git to consider it a total
536rewrite (i.e. otherwise the resulting patch will be a series of
537deletion and insertion mixed together with context lines).</p></div>
538<div class="para"><p>When used with -M, a totally-rewritten file is also considered as the
539source of a rename (usually -M only considers a file that disappeared
540as the source of a rename), and the number <tt>n</tt> controls this aspect of
541the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
542addition and deletion compared to 20% or more of the file's size are
543eligible for being picked up as a possible source of a rename to
544another file.</p></div>
Junio C Hamano60f8aa82007-03-06 09:58:26545</dd>
546<dt>
Junio C Hamanoe85e36f2010-08-10 05:30:14547-M[&lt;n&gt;]
Junio C Hamano60f8aa82007-03-06 09:58:26548</dt>
549<dd>
550<p>
551 Detect renames.
Junio C Hamanoe85e36f2010-08-10 05:30:14552 If <tt>n</tt> is specified, it is a is a threshold on the similarity
553 index (i.e. amount of addition/deletions compared to the
554 file's size). For example, <tt>-M90%</tt> means git should consider a
555 delete/add pair to be a rename if more than 90% of the file
556 hasn't changed.
Junio C Hamano60f8aa82007-03-06 09:58:26557</p>
558</dd>
559<dt>
Junio C Hamanoe85e36f2010-08-10 05:30:14560-C[&lt;n&gt;]
Junio C Hamano60f8aa82007-03-06 09:58:26561</dt>
562<dd>
563<p>
Junio C Hamano16f98872007-06-12 16:09:14564 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamanoe85e36f2010-08-10 05:30:14565 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
Junio C Hamano60f8aa82007-03-06 09:58:26566</p>
567</dd>
568<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26569--find-copies-harder
570</dt>
571<dd>
572<p>
Junio C Hamano16f98872007-06-12 16:09:14573 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano60f8aa82007-03-06 09:58:26574 if the original file of the copy was modified in the same
575 changeset. This flag makes the command
576 inspect unmodified files as candidates for the source of
577 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:14578 projects, so use it with caution. Giving more than one
579 <tt>-C</tt> option has the same effect.
Junio C Hamano60f8aa82007-03-06 09:58:26580</p>
581</dd>
582<dt>
583-l&lt;num&gt;
584</dt>
585<dd>
586<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37587 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
Junio C Hamano60f8aa82007-03-06 09:58:26588 is the number of potential rename/copy targets. This
589 option prevents rename/copy detection from running if
590 the number of rename/copy targets exceeds the specified
591 number.
592</p>
593</dd>
594<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26595-O&lt;orderfile&gt;
596</dt>
597<dd>
598<p>
599 Output the patch in the order specified in the
600 &lt;orderfile&gt;, which has one shell glob pattern per line.
601</p>
602</dd>
603<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22604-a
605</dt>
606<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26607--text
608</dt>
609<dd>
610<p>
611 Treat all files as text.
612</p>
613</dd>
614<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26615--ignore-space-at-eol
616</dt>
617<dd>
618<p>
Junio C Hamano3a702342007-12-12 21:34:02619 Ignore changes in whitespace at EOL.
Junio C Hamano60f8aa82007-03-06 09:58:26620</p>
621</dd>
622<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22623-b
624</dt>
625<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26626--ignore-space-change
627</dt>
628<dd>
629<p>
Junio C Hamano3a702342007-12-12 21:34:02630 Ignore changes in amount of whitespace. This ignores whitespace
631 at line end, and considers all other sequences of one or
632 more whitespace characters to be equivalent.
Junio C Hamano60f8aa82007-03-06 09:58:26633</p>
634</dd>
635<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22636-w
Junio C Hamano60f8aa82007-03-06 09:58:26637</dt>
Junio C Hamano60f8aa82007-03-06 09:58:26638<dt>
639--ignore-all-space
640</dt>
641<dd>
642<p>
Junio C Hamano3a702342007-12-12 21:34:02643 Ignore whitespace when comparing lines. This ignores
644 differences even if one line has whitespace where the other
Junio C Hamano60f8aa82007-03-06 09:58:26645 line has none.
646</p>
647</dd>
648<dt>
Junio C Hamano1d40ee82009-01-07 10:14:16649--inter-hunk-context=&lt;lines&gt;
650</dt>
651<dd>
652<p>
653 Show the context between diff hunks, up to the specified number
654 of lines, thereby fusing hunks that are close to each other.
655</p>
656</dd>
657<dt>
Junio C Hamanobb0f4042007-07-04 06:41:40658--ext-diff
659</dt>
660<dd>
661<p>
662 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:53663 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
664 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:40665</p>
666</dd>
667<dt>
668--no-ext-diff
669</dt>
670<dd>
671<p>
672 Disallow external diff drivers.
673</p>
674</dd>
Junio C Hamanoe27cbd22007-12-21 17:57:33675<dt>
Junio C Hamano7d449522010-07-01 00:08:51676--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:14677</dt>
678<dd>
679<p>
Junio C Hamano7d449522010-07-01 00:08:51680 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
681 either "untracked", "dirty" or "all", which is the default. When
682 "untracked" is used submodules are not considered dirty when they only
683 contain untracked content (but they are still scanned for modified
684 content). Using "dirty" ignores all changes to the work tree of submodules,
685 only changes to the commits stored in the superproject are shown (this was
686 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:14687</p>
688</dd>
689<dt>
Junio C Hamanoe27cbd22007-12-21 17:57:33690--src-prefix=&lt;prefix&gt;
691</dt>
692<dd>
693<p>
694 Show the given source prefix instead of "a/".
695</p>
696</dd>
697<dt>
698--dst-prefix=&lt;prefix&gt;
699</dt>
700<dd>
701<p>
702 Show the given destination prefix instead of "b/".
703</p>
704</dd>
705<dt>
706--no-prefix
707</dt>
708<dd>
709<p>
710 Do not show any source or destination prefix.
711</p>
712</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31713</dl></div>
714<div class="para"><p>For more detailed explanation on these common options, see also
715<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
716<div class="vlist"><dl>
Junio C Hamano60f8aa82007-03-06 09:58:26717<dt>
Junio C Hamanobb0f4042007-07-04 06:41:40718-&lt;n&gt;
719</dt>
720<dd>
721<p>
722 Limits the number of patches to prepare.
723</p>
724</dd>
725<dt>
Junio C Hamanoeb415992008-06-08 22:49:47726-o &lt;dir&gt;
727</dt>
728<dt>
729--output-directory &lt;dir&gt;
Junio C Hamano1a4e8412005-12-27 08:17:23730</dt>
731<dd>
732<p>
733 Use &lt;dir&gt; to store the resulting files, instead of the
Junio C Hamano1bab4b02006-06-06 21:58:33734 current working directory.
Junio C Hamano1a4e8412005-12-27 08:17:23735</p>
736</dd>
737<dt>
Junio C Hamanoeb415992008-06-08 22:49:47738-n
739</dt>
740<dt>
741--numbered
Junio C Hamano1a4e8412005-12-27 08:17:23742</dt>
743<dd>
744<p>
Junio C Hamano7d06a8a2008-10-20 05:42:33745 Name output in <em>[PATCH n/m]</em> format, even with a single patch.
Junio C Hamano1a4e8412005-12-27 08:17:23746</p>
747</dd>
748<dt>
Junio C Hamanoeb415992008-06-08 22:49:47749-N
750</dt>
751<dt>
752--no-numbered
Junio C Hamano8c5802d2007-11-15 00:13:36753</dt>
754<dd>
755<p>
756 Name output in <em>[PATCH]</em> format.
757</p>
758</dd>
759<dt>
Junio C Hamano341071d2006-06-04 07:24:48760--start-number &lt;n&gt;
761</dt>
762<dd>
763<p>
764 Start numbering the patches at &lt;n&gt; instead of 1.
765</p>
766</dd>
767<dt>
Junio C Hamano94cad1a2007-06-06 10:48:25768--numbered-files
769</dt>
770<dd>
771<p>
772 Output file names will be a simple number sequence
773 without the default first line of the commit appended.
Junio C Hamano94cad1a2007-06-06 10:48:25774</p>
775</dd>
776<dt>
Junio C Hamanoeb415992008-06-08 22:49:47777-k
778</dt>
779<dt>
780--keep-subject
Junio C Hamano1a4e8412005-12-27 08:17:23781</dt>
782<dd>
783<p>
784 Do not strip/add <em>[PATCH]</em> from the first line of the
785 commit log message.
786</p>
787</dd>
788<dt>
Junio C Hamanoeb415992008-06-08 22:49:47789-s
790</dt>
791<dt>
792--signoff
Junio C Hamano1a4e8412005-12-27 08:17:23793</dt>
794<dd>
795<p>
796 Add <tt>Signed-off-by:</tt> line to the commit message, using
797 the committer identity of yourself.
798</p>
799</dd>
800<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23801--stdout
802</dt>
803<dd>
804<p>
Junio C Hamano341071d2006-06-04 07:24:48805 Print all commits to the standard output in mbox format,
806 instead of creating a file for each one.
Junio C Hamano1a4e8412005-12-27 08:17:23807</p>
808</dd>
Junio C Hamano2496ae42006-03-11 08:04:33809<dt>
Junio C Hamanoc51fede2007-03-12 07:29:20810--attach[=&lt;boundary&gt;]
Junio C Hamano2496ae42006-03-11 08:04:33811</dt>
812<dd>
813<p>
Junio C Hamanoc51fede2007-03-12 07:29:20814 Create multipart/mixed attachment, the first part of
815 which is the commit message and the patch itself in the
Junio C Hamano3b70d3c2009-11-21 17:37:37816 second part, with <tt>Content-Disposition: attachment</tt>.
Junio C Hamanoc51fede2007-03-12 07:29:20817</p>
818</dd>
819<dt>
Junio C Hamano0a235222009-03-06 08:21:09820--no-attach
821</dt>
822<dd>
823<p>
824 Disable the creation of an attachment, overriding the
825 configuration setting.
826</p>
827</dd>
828<dt>
Junio C Hamanoc51fede2007-03-12 07:29:20829--inline[=&lt;boundary&gt;]
830</dt>
831<dd>
832<p>
833 Create multipart/mixed attachment, the first part of
834 which is the commit message and the patch itself in the
Junio C Hamano3b70d3c2009-11-21 17:37:37835 second part, with <tt>Content-Disposition: inline</tt>.
Junio C Hamano2496ae42006-03-11 08:04:33836</p>
837</dd>
Junio C Hamanof9ca97d2006-07-25 22:23:09838<dt>
Junio C Hamanoea6a7642009-03-11 23:56:19839--thread[=&lt;style&gt;]
Junio C Hamanof9ca97d2006-07-25 22:23:09840</dt>
Junio C Hamano1bbd0f42009-07-23 06:20:29841<dt>
842--no-thread
843</dt>
Junio C Hamanof9ca97d2006-07-25 22:23:09844<dd>
845<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37846 Controls addition of <tt>In-Reply-To</tt> and <tt>References</tt> headers to
Junio C Hamano1bbd0f42009-07-23 06:20:29847 make the second and subsequent mails appear as replies to the
Junio C Hamano3b70d3c2009-11-21 17:37:37848 first. Also controls generation of the <tt>Message-Id</tt> header to
Junio C Hamano1bbd0f42009-07-23 06:20:29849 reference.
Junio C Hamanof9ca97d2006-07-25 22:23:09850</p>
Junio C Hamanoea6a7642009-03-11 23:56:19851<div class="para"><p>The optional &lt;style&gt; argument can be either <tt>shallow</tt> or <tt>deep</tt>.
Junio C Hamanof4581102009-04-25 08:29:59852<em>shallow</em> threading makes every mail a reply to the head of the
Junio C Hamanoea6a7642009-03-11 23:56:19853series, where the head is chosen from the cover letter, the
Junio C Hamanof4581102009-04-25 08:29:59854<tt>--in-reply-to</tt>, and the first patch mail, in this order. <em>deep</em>
Junio C Hamano1bbd0f42009-07-23 06:20:29855threading makes every mail a reply to the previous one.</p></div>
Junio C Hamano3b70d3c2009-11-21 17:37:37856<div class="para"><p>The default is <tt>--no-thread</tt>, unless the <em>format.thread</em> configuration
857is set. If <tt>--thread</tt> is specified without a style, it defaults to the
Junio C Hamano1bbd0f42009-07-23 06:20:29858style specified by <em>format.thread</em> if any, or else <tt>shallow</tt>.</p></div>
859<div class="para"><p>Beware that the default for <em>git send-email</em> is to thread emails
Junio C Hamano3b70d3c2009-11-21 17:37:37860itself. If you want <tt>git format-patch</tt> to take care of threading, you
861will want to ensure that threading is disabled for <tt>git send-email</tt>.</p></div>
Junio C Hamanof9ca97d2006-07-25 22:23:09862</dd>
863<dt>
864--in-reply-to=Message-Id
865</dt>
866<dd>
867<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37868 Make the first mail (or all the mails with <tt>--no-thread</tt>) appear as a
Junio C Hamanof9ca97d2006-07-25 22:23:09869 reply to the given Message-Id, which avoids breaking threads to
870 provide a new patch series.
871</p>
872</dd>
Junio C Hamano4f9a6052007-01-17 20:25:16873<dt>
Junio C Hamano7c73c662007-01-19 00:37:50874--ignore-if-in-upstream
875</dt>
876<dd>
877<p>
878 Do not include a patch that matches a commit in
879 &lt;until&gt;..&lt;since&gt;. This will examine all patches reachable
880 from &lt;since&gt; but not from &lt;until&gt; and compare them with the
881 patches being generated, and any patch that matches is
882 ignored.
883</p>
884</dd>
885<dt>
Junio C Hamano6f1cca82007-04-12 05:02:47886--subject-prefix=&lt;Subject-Prefix&gt;
887</dt>
888<dd>
889<p>
890 Instead of the standard <em>[PATCH]</em> prefix in the subject
891 line, instead use <em>[&lt;Subject-Prefix&gt;]</em>. This
892 allows for useful naming of a patch series, and can be
Junio C Hamano3b70d3c2009-11-21 17:37:37893 combined with the <tt>--numbered</tt> option.
Junio C Hamano6f1cca82007-04-12 05:02:47894</p>
895</dd>
896<dt>
Junio C Hamanoea90ab32010-03-15 20:32:55897--to=&lt;email&gt;
898</dt>
899<dd>
900<p>
901 Add a <tt>To:</tt> header to the email headers. This is in addition
902 to any configured headers, and may be used multiple times.
903</p>
904</dd>
905<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44906--cc=&lt;email&gt;
907</dt>
908<dd>
909<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37910 Add a <tt>Cc:</tt> header to the email headers. This is in addition
Junio C Hamano24bc09a2008-02-28 00:27:44911 to any configured headers, and may be used multiple times.
912</p>
913</dd>
914<dt>
Junio C Hamano9572e922009-04-02 06:52:03915--add-header=&lt;header&gt;
916</dt>
917<dd>
918<p>
919 Add an arbitrary header to the email headers. This is in addition
920 to any configured headers, and may be used multiple times.
Junio C Hamano3b70d3c2009-11-21 17:37:37921 For example, <tt>--add-header="Organization: git-foo"</tt>
Junio C Hamano9572e922009-04-02 06:52:03922</p>
923</dd>
924<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44925--cover-letter
926</dt>
927<dd>
928<p>
Junio C Hamano92a4abd2008-08-15 05:34:44929 In addition to the patches, generate a cover letter file
930 containing the shortlog and the overall diffstat. You can
931 fill in a description in the file before sending it out.
Junio C Hamano24bc09a2008-02-28 00:27:44932</p>
933</dd>
934<dt>
Junio C Hamano89a57342010-06-22 23:22:55935--[no]-signature=&lt;signature&gt;
936</dt>
937<dd>
938<p>
939 Add a signature to each message produced. Per RFC 3676 the signature
940 is separated from the body by a line with <em>-- </em> on it. If the
941 signature option is omitted the signature defaults to the git version
942 number.
943</p>
944</dd>
945<dt>
Junio C Hamano4f9a6052007-01-17 20:25:16946--suffix=.&lt;sfx&gt;
947</dt>
948<dd>
949<p>
Junio C Hamano7c73c662007-01-19 00:37:50950 Instead of using <tt>.patch</tt> as the suffix for generated
Junio C Hamanoa6387422007-08-25 03:54:27951 filenames, use specified suffix. A common alternative is
Junio C Hamanof4581102009-04-25 08:29:59952 <tt>--suffix=.txt</tt>. Leaving this empty will remove the <tt>.patch</tt>
953 suffix.
Junio C Hamano4f9a6052007-01-17 20:25:16954</p>
Junio C Hamanof4581102009-04-25 08:29:59955<div class="para"><p>Note that the leading character does not have to be a dot; for example,
956you can use <tt>--suffix=-patch</tt> to get <tt>0001-description-of-my-change-patch</tt>.</p></div>
Junio C Hamano4f9a6052007-01-17 20:25:16957</dd>
Junio C Hamano869bb802008-05-12 00:29:47958<dt>
959--no-binary
960</dt>
961<dd>
962<p>
Junio C Hamanof4581102009-04-25 08:29:59963 Do not output contents of changes in binary files, instead
964 display a notice that those files changed. Patches generated
965 using this option cannot be applied properly, but they are
966 still useful for code review.
Junio C Hamano869bb802008-05-12 00:29:47967</p>
968</dd>
Junio C Hamano9572e922009-04-02 06:52:03969<dt>
970--root
971</dt>
972<dd>
973<p>
974 Treat the revision argument as a &lt;revision range&gt;, even if it
975 is just a single commit (that would normally be treated as a
976 &lt;since&gt;). Note that root commits included in the specified
977 range are always formatted as creation patches, independently
978 of this flag.
979</p>
980</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31981</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:23982</div>
Junio C Hamanoba4b9282008-07-06 05:20:31983<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamano2496ae42006-03-11 08:04:33984<div class="sectionbody">
Junio C Hamanof4581102009-04-25 08:29:59985<div class="para"><p>You can specify extra mail header lines to be added to each message,
986defaults for the subject prefix and file suffix, number patches when
Junio C Hamanoea90ab32010-03-15 20:32:55987outputting more than one patch, add "To" or "Cc:" headers, configure
988attachments, and sign off patches with configuration variables.</p></div>
Junio C Hamano7c73c662007-01-19 00:37:50989<div class="listingblock">
Junio C Hamano2496ae42006-03-11 08:04:33990<div class="content">
Junio C Hamano7c73c662007-01-19 00:37:50991<pre><tt>[format]
992 headers = "Organization: git-foo\n"
Junio C Hamano1d90cb02007-07-03 07:05:31993 subjectprefix = CHANGE
Junio C Hamano8c5802d2007-11-15 00:13:36994 suffix = .txt
Junio C Hamano2fbcd212008-05-14 22:26:07995 numbered = auto
Junio C Hamanoea90ab32010-03-15 20:32:55996 to = &lt;email&gt;
Junio C Hamano0a235222009-03-06 08:21:09997 cc = &lt;email&gt;
Junio C Hamano5f9a6f02009-04-06 08:26:56998 attach [ = mime-boundary-string ]
999 signoff = true</tt></pre>
Junio C Hamano4f9a6052007-01-17 20:25:161000</div></div>
Junio C Hamano2496ae42006-03-11 08:04:331001</div>
Junio C Hamanoba4b9282008-07-06 05:20:311002<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231003<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311004<div class="ilist"><ul>
Junio C Hamano6d76d612008-05-09 05:46:081005<li>
Junio C Hamano1a4e8412005-12-27 08:17:231006<p>
Junio C Hamano6d76d612008-05-09 05:46:081007Extract commits between revisions R1 and R2, and apply them on top of
Junio C Hamano1aa40d22010-01-21 17:46:431008the current branch using <em>git am</em> to cherry-pick them:
Junio C Hamano1a4e8412005-12-27 08:17:231009</p>
Junio C Hamano6d76d612008-05-09 05:46:081010<div class="listingblock">
1011<div class="content">
Junio C Hamanoba4b9282008-07-06 05:20:311012<pre><tt>$ git format-patch -k --stdout R1..R2 | git am -3 -k</tt></pre>
Junio C Hamano6d76d612008-05-09 05:46:081013</div></div>
1014</li>
1015<li>
Junio C Hamano1a4e8412005-12-27 08:17:231016<p>
Junio C Hamano6d76d612008-05-09 05:46:081017Extract all commits which are in the current branch but not in the
1018origin branch:
Junio C Hamano1a4e8412005-12-27 08:17:231019</p>
Junio C Hamano6d76d612008-05-09 05:46:081020<div class="listingblock">
1021<div class="content">
1022<pre><tt>$ git format-patch origin</tt></pre>
1023</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311024<div class="para"><p>For each commit a separate file is created in the current directory.</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081025</li>
1026<li>
Junio C Hamano7d9e9bd2007-08-29 07:31:471027<p>
Junio C Hamano6d76d612008-05-09 05:46:081028Extract all commits that lead to <em>origin</em> since the inception of the
1029project:
Junio C Hamano7d9e9bd2007-08-29 07:31:471030</p>
Junio C Hamano6d76d612008-05-09 05:46:081031<div class="listingblock">
1032<div class="content">
Junio C Hamanoba4b9282008-07-06 05:20:311033<pre><tt>$ git format-patch --root origin</tt></pre>
Junio C Hamano6d76d612008-05-09 05:46:081034</div></div>
1035</li>
1036<li>
Junio C Hamano1a4e8412005-12-27 08:17:231037<p>
Junio C Hamano6d76d612008-05-09 05:46:081038The same as the previous one:
Junio C Hamano1a4e8412005-12-27 08:17:231039</p>
Junio C Hamano6d76d612008-05-09 05:46:081040<div class="listingblock">
1041<div class="content">
1042<pre><tt>$ git format-patch -M -B origin</tt></pre>
1043</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311044<div class="para"><p>Additionally, it detects and handles renames and complete rewrites
Junio C Hamano6d76d612008-05-09 05:46:081045intelligently to produce a renaming patch. A renaming patch reduces
Junio C Hamanof4581102009-04-25 08:29:591046the amount of text output, and generally makes it easier to review.
1047Note that non-git "patch" programs won't understand renaming patches, so
Junio C Hamanoba4b9282008-07-06 05:20:311048use it only when you know the recipient uses git to apply your patch.</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081049</li>
1050<li>
Junio C Hamano7c73c662007-01-19 00:37:501051<p>
Junio C Hamano6d76d612008-05-09 05:46:081052Extract three topmost commits from the current branch and format them
1053as e-mailable patches:
Junio C Hamano7c73c662007-01-19 00:37:501054</p>
Junio C Hamano6d76d612008-05-09 05:46:081055<div class="listingblock">
1056<div class="content">
1057<pre><tt>$ git format-patch -3</tt></pre>
1058</div></div>
1059</li>
Junio C Hamanoba4b9282008-07-06 05:20:311060</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231061</div>
Junio C Hamanoba4b9282008-07-06 05:20:311062<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231063<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311064<div class="para"><p><a href="git-am.html">git-am(1)</a>, <a href="git-send-email.html">git-send-email(1)</a></p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231065</div>
Junio C Hamanoba4b9282008-07-06 05:20:311066<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231067<div class="sectionbody">
Junio C Hamano0868a302008-07-22 09:20:441068<div class="para"><p>Written by Junio C Hamano &lt;gitster@pobox.com&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231069</div>
Junio C Hamanoba4b9282008-07-06 05:20:311070<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231071<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311072<div class="para"><p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231073</div>
Junio C Hamanoba4b9282008-07-06 05:20:311074<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231075<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311076<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231077</div>
1078<div id="footer">
1079<div id="footer-text">
Junio C Hamanoe85e36f2010-08-10 05:30:141080Last updated 2010-08-10 05:29:40 UTC
Junio C Hamano1a4e8412005-12-27 08:17:231081</div>
1082</div>
1083</body>
1084</html>