blob: 1f0c8d0b018b0c37160943af2248dbe9dfba67e5 [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
357 REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>) means the
358 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>
522-B
523</dt>
524<dd>
525<p>
526 Break complete rewrite changes into pairs of delete and create.
527</p>
528</dd>
529<dt>
530-M
531</dt>
532<dd>
533<p>
534 Detect renames.
535</p>
536</dd>
537<dt>
538-C
539</dt>
540<dd>
541<p>
Junio C Hamano16f98872007-06-12 16:09:14542 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamano60f8aa82007-03-06 09:58:26543</p>
544</dd>
545<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26546--find-copies-harder
547</dt>
548<dd>
549<p>
Junio C Hamano16f98872007-06-12 16:09:14550 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano60f8aa82007-03-06 09:58:26551 if the original file of the copy was modified in the same
552 changeset. This flag makes the command
553 inspect unmodified files as candidates for the source of
554 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:14555 projects, so use it with caution. Giving more than one
556 <tt>-C</tt> option has the same effect.
Junio C Hamano60f8aa82007-03-06 09:58:26557</p>
558</dd>
559<dt>
560-l&lt;num&gt;
561</dt>
562<dd>
563<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37564 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
Junio C Hamano60f8aa82007-03-06 09:58:26565 is the number of potential rename/copy targets. This
566 option prevents rename/copy detection from running if
567 the number of rename/copy targets exceeds the specified
568 number.
569</p>
570</dd>
571<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26572-O&lt;orderfile&gt;
573</dt>
574<dd>
575<p>
576 Output the patch in the order specified in the
577 &lt;orderfile&gt;, which has one shell glob pattern per line.
578</p>
579</dd>
580<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22581-a
582</dt>
583<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26584--text
585</dt>
586<dd>
587<p>
588 Treat all files as text.
589</p>
590</dd>
591<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26592--ignore-space-at-eol
593</dt>
594<dd>
595<p>
Junio C Hamano3a702342007-12-12 21:34:02596 Ignore changes in whitespace at EOL.
Junio C Hamano60f8aa82007-03-06 09:58:26597</p>
598</dd>
599<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22600-b
601</dt>
602<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26603--ignore-space-change
604</dt>
605<dd>
606<p>
Junio C Hamano3a702342007-12-12 21:34:02607 Ignore changes in amount of whitespace. This ignores whitespace
608 at line end, and considers all other sequences of one or
609 more whitespace characters to be equivalent.
Junio C Hamano60f8aa82007-03-06 09:58:26610</p>
611</dd>
612<dt>
Junio C Hamanobbbb8652008-12-29 10:34:22613-w
Junio C Hamano60f8aa82007-03-06 09:58:26614</dt>
Junio C Hamano60f8aa82007-03-06 09:58:26615<dt>
616--ignore-all-space
617</dt>
618<dd>
619<p>
Junio C Hamano3a702342007-12-12 21:34:02620 Ignore whitespace when comparing lines. This ignores
621 differences even if one line has whitespace where the other
Junio C Hamano60f8aa82007-03-06 09:58:26622 line has none.
623</p>
624</dd>
625<dt>
Junio C Hamano1d40ee82009-01-07 10:14:16626--inter-hunk-context=&lt;lines&gt;
627</dt>
628<dd>
629<p>
630 Show the context between diff hunks, up to the specified number
631 of lines, thereby fusing hunks that are close to each other.
632</p>
633</dd>
634<dt>
Junio C Hamanobb0f4042007-07-04 06:41:40635--ext-diff
636</dt>
637<dd>
638<p>
639 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:53640 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
641 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:40642</p>
643</dd>
644<dt>
645--no-ext-diff
646</dt>
647<dd>
648<p>
649 Disallow external diff drivers.
650</p>
651</dd>
Junio C Hamanoe27cbd22007-12-21 17:57:33652<dt>
Junio C Hamano7d449522010-07-01 00:08:51653--ignore-submodules[=&lt;when&gt;]
Junio C Hamanodfccbb02008-05-26 01:16:14654</dt>
655<dd>
656<p>
Junio C Hamano7d449522010-07-01 00:08:51657 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
658 either "untracked", "dirty" or "all", which is the default. When
659 "untracked" is used submodules are not considered dirty when they only
660 contain untracked content (but they are still scanned for modified
661 content). Using "dirty" ignores all changes to the work tree of submodules,
662 only changes to the commits stored in the superproject are shown (this was
663 the behavior until 1.7.0). Using "all" hides all changes to submodules.
Junio C Hamanodfccbb02008-05-26 01:16:14664</p>
665</dd>
666<dt>
Junio C Hamanoe27cbd22007-12-21 17:57:33667--src-prefix=&lt;prefix&gt;
668</dt>
669<dd>
670<p>
671 Show the given source prefix instead of "a/".
672</p>
673</dd>
674<dt>
675--dst-prefix=&lt;prefix&gt;
676</dt>
677<dd>
678<p>
679 Show the given destination prefix instead of "b/".
680</p>
681</dd>
682<dt>
683--no-prefix
684</dt>
685<dd>
686<p>
687 Do not show any source or destination prefix.
688</p>
689</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31690</dl></div>
691<div class="para"><p>For more detailed explanation on these common options, see also
692<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
693<div class="vlist"><dl>
Junio C Hamano60f8aa82007-03-06 09:58:26694<dt>
Junio C Hamanobb0f4042007-07-04 06:41:40695-&lt;n&gt;
696</dt>
697<dd>
698<p>
699 Limits the number of patches to prepare.
700</p>
701</dd>
702<dt>
Junio C Hamanoeb415992008-06-08 22:49:47703-o &lt;dir&gt;
704</dt>
705<dt>
706--output-directory &lt;dir&gt;
Junio C Hamano1a4e8412005-12-27 08:17:23707</dt>
708<dd>
709<p>
710 Use &lt;dir&gt; to store the resulting files, instead of the
Junio C Hamano1bab4b02006-06-06 21:58:33711 current working directory.
Junio C Hamano1a4e8412005-12-27 08:17:23712</p>
713</dd>
714<dt>
Junio C Hamanoeb415992008-06-08 22:49:47715-n
716</dt>
717<dt>
718--numbered
Junio C Hamano1a4e8412005-12-27 08:17:23719</dt>
720<dd>
721<p>
Junio C Hamano7d06a8a2008-10-20 05:42:33722 Name output in <em>[PATCH n/m]</em> format, even with a single patch.
Junio C Hamano1a4e8412005-12-27 08:17:23723</p>
724</dd>
725<dt>
Junio C Hamanoeb415992008-06-08 22:49:47726-N
727</dt>
728<dt>
729--no-numbered
Junio C Hamano8c5802d2007-11-15 00:13:36730</dt>
731<dd>
732<p>
733 Name output in <em>[PATCH]</em> format.
734</p>
735</dd>
736<dt>
Junio C Hamano341071d2006-06-04 07:24:48737--start-number &lt;n&gt;
738</dt>
739<dd>
740<p>
741 Start numbering the patches at &lt;n&gt; instead of 1.
742</p>
743</dd>
744<dt>
Junio C Hamano94cad1a2007-06-06 10:48:25745--numbered-files
746</dt>
747<dd>
748<p>
749 Output file names will be a simple number sequence
750 without the default first line of the commit appended.
Junio C Hamano94cad1a2007-06-06 10:48:25751</p>
752</dd>
753<dt>
Junio C Hamanoeb415992008-06-08 22:49:47754-k
755</dt>
756<dt>
757--keep-subject
Junio C Hamano1a4e8412005-12-27 08:17:23758</dt>
759<dd>
760<p>
761 Do not strip/add <em>[PATCH]</em> from the first line of the
762 commit log message.
763</p>
764</dd>
765<dt>
Junio C Hamanoeb415992008-06-08 22:49:47766-s
767</dt>
768<dt>
769--signoff
Junio C Hamano1a4e8412005-12-27 08:17:23770</dt>
771<dd>
772<p>
773 Add <tt>Signed-off-by:</tt> line to the commit message, using
774 the committer identity of yourself.
775</p>
776</dd>
777<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23778--stdout
779</dt>
780<dd>
781<p>
Junio C Hamano341071d2006-06-04 07:24:48782 Print all commits to the standard output in mbox format,
783 instead of creating a file for each one.
Junio C Hamano1a4e8412005-12-27 08:17:23784</p>
785</dd>
Junio C Hamano2496ae42006-03-11 08:04:33786<dt>
Junio C Hamanoc51fede2007-03-12 07:29:20787--attach[=&lt;boundary&gt;]
Junio C Hamano2496ae42006-03-11 08:04:33788</dt>
789<dd>
790<p>
Junio C Hamanoc51fede2007-03-12 07:29:20791 Create multipart/mixed attachment, the first part of
792 which is the commit message and the patch itself in the
Junio C Hamano3b70d3c2009-11-21 17:37:37793 second part, with <tt>Content-Disposition: attachment</tt>.
Junio C Hamanoc51fede2007-03-12 07:29:20794</p>
795</dd>
796<dt>
Junio C Hamano0a235222009-03-06 08:21:09797--no-attach
798</dt>
799<dd>
800<p>
801 Disable the creation of an attachment, overriding the
802 configuration setting.
803</p>
804</dd>
805<dt>
Junio C Hamanoc51fede2007-03-12 07:29:20806--inline[=&lt;boundary&gt;]
807</dt>
808<dd>
809<p>
810 Create multipart/mixed attachment, the first part of
811 which is the commit message and the patch itself in the
Junio C Hamano3b70d3c2009-11-21 17:37:37812 second part, with <tt>Content-Disposition: inline</tt>.
Junio C Hamano2496ae42006-03-11 08:04:33813</p>
814</dd>
Junio C Hamanof9ca97d2006-07-25 22:23:09815<dt>
Junio C Hamanoea6a7642009-03-11 23:56:19816--thread[=&lt;style&gt;]
Junio C Hamanof9ca97d2006-07-25 22:23:09817</dt>
Junio C Hamano1bbd0f42009-07-23 06:20:29818<dt>
819--no-thread
820</dt>
Junio C Hamanof9ca97d2006-07-25 22:23:09821<dd>
822<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37823 Controls addition of <tt>In-Reply-To</tt> and <tt>References</tt> headers to
Junio C Hamano1bbd0f42009-07-23 06:20:29824 make the second and subsequent mails appear as replies to the
Junio C Hamano3b70d3c2009-11-21 17:37:37825 first. Also controls generation of the <tt>Message-Id</tt> header to
Junio C Hamano1bbd0f42009-07-23 06:20:29826 reference.
Junio C Hamanof9ca97d2006-07-25 22:23:09827</p>
Junio C Hamanoea6a7642009-03-11 23:56:19828<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:59829<em>shallow</em> threading makes every mail a reply to the head of the
Junio C Hamanoea6a7642009-03-11 23:56:19830series, where the head is chosen from the cover letter, the
Junio C Hamanof4581102009-04-25 08:29:59831<tt>--in-reply-to</tt>, and the first patch mail, in this order. <em>deep</em>
Junio C Hamano1bbd0f42009-07-23 06:20:29832threading makes every mail a reply to the previous one.</p></div>
Junio C Hamano3b70d3c2009-11-21 17:37:37833<div class="para"><p>The default is <tt>--no-thread</tt>, unless the <em>format.thread</em> configuration
834is set. If <tt>--thread</tt> is specified without a style, it defaults to the
Junio C Hamano1bbd0f42009-07-23 06:20:29835style specified by <em>format.thread</em> if any, or else <tt>shallow</tt>.</p></div>
836<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:37837itself. If you want <tt>git format-patch</tt> to take care of threading, you
838will want to ensure that threading is disabled for <tt>git send-email</tt>.</p></div>
Junio C Hamanof9ca97d2006-07-25 22:23:09839</dd>
840<dt>
841--in-reply-to=Message-Id
842</dt>
843<dd>
844<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37845 Make the first mail (or all the mails with <tt>--no-thread</tt>) appear as a
Junio C Hamanof9ca97d2006-07-25 22:23:09846 reply to the given Message-Id, which avoids breaking threads to
847 provide a new patch series.
848</p>
849</dd>
Junio C Hamano4f9a6052007-01-17 20:25:16850<dt>
Junio C Hamano7c73c662007-01-19 00:37:50851--ignore-if-in-upstream
852</dt>
853<dd>
854<p>
855 Do not include a patch that matches a commit in
856 &lt;until&gt;..&lt;since&gt;. This will examine all patches reachable
857 from &lt;since&gt; but not from &lt;until&gt; and compare them with the
858 patches being generated, and any patch that matches is
859 ignored.
860</p>
861</dd>
862<dt>
Junio C Hamano6f1cca82007-04-12 05:02:47863--subject-prefix=&lt;Subject-Prefix&gt;
864</dt>
865<dd>
866<p>
867 Instead of the standard <em>[PATCH]</em> prefix in the subject
868 line, instead use <em>[&lt;Subject-Prefix&gt;]</em>. This
869 allows for useful naming of a patch series, and can be
Junio C Hamano3b70d3c2009-11-21 17:37:37870 combined with the <tt>--numbered</tt> option.
Junio C Hamano6f1cca82007-04-12 05:02:47871</p>
872</dd>
873<dt>
Junio C Hamanoea90ab32010-03-15 20:32:55874--to=&lt;email&gt;
875</dt>
876<dd>
877<p>
878 Add a <tt>To:</tt> header to the email headers. This is in addition
879 to any configured headers, and may be used multiple times.
880</p>
881</dd>
882<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44883--cc=&lt;email&gt;
884</dt>
885<dd>
886<p>
Junio C Hamano3b70d3c2009-11-21 17:37:37887 Add a <tt>Cc:</tt> header to the email headers. This is in addition
Junio C Hamano24bc09a2008-02-28 00:27:44888 to any configured headers, and may be used multiple times.
889</p>
890</dd>
891<dt>
Junio C Hamano9572e922009-04-02 06:52:03892--add-header=&lt;header&gt;
893</dt>
894<dd>
895<p>
896 Add an arbitrary header to the email headers. This is in addition
897 to any configured headers, and may be used multiple times.
Junio C Hamano3b70d3c2009-11-21 17:37:37898 For example, <tt>--add-header="Organization: git-foo"</tt>
Junio C Hamano9572e922009-04-02 06:52:03899</p>
900</dd>
901<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44902--cover-letter
903</dt>
904<dd>
905<p>
Junio C Hamano92a4abd2008-08-15 05:34:44906 In addition to the patches, generate a cover letter file
907 containing the shortlog and the overall diffstat. You can
908 fill in a description in the file before sending it out.
Junio C Hamano24bc09a2008-02-28 00:27:44909</p>
910</dd>
911<dt>
Junio C Hamano89a57342010-06-22 23:22:55912--[no]-signature=&lt;signature&gt;
913</dt>
914<dd>
915<p>
916 Add a signature to each message produced. Per RFC 3676 the signature
917 is separated from the body by a line with <em>-- </em> on it. If the
918 signature option is omitted the signature defaults to the git version
919 number.
920</p>
921</dd>
922<dt>
Junio C Hamano4f9a6052007-01-17 20:25:16923--suffix=.&lt;sfx&gt;
924</dt>
925<dd>
926<p>
Junio C Hamano7c73c662007-01-19 00:37:50927 Instead of using <tt>.patch</tt> as the suffix for generated
Junio C Hamanoa6387422007-08-25 03:54:27928 filenames, use specified suffix. A common alternative is
Junio C Hamanof4581102009-04-25 08:29:59929 <tt>--suffix=.txt</tt>. Leaving this empty will remove the <tt>.patch</tt>
930 suffix.
Junio C Hamano4f9a6052007-01-17 20:25:16931</p>
Junio C Hamanof4581102009-04-25 08:29:59932<div class="para"><p>Note that the leading character does not have to be a dot; for example,
933you 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:16934</dd>
Junio C Hamano869bb802008-05-12 00:29:47935<dt>
936--no-binary
937</dt>
938<dd>
939<p>
Junio C Hamanof4581102009-04-25 08:29:59940 Do not output contents of changes in binary files, instead
941 display a notice that those files changed. Patches generated
942 using this option cannot be applied properly, but they are
943 still useful for code review.
Junio C Hamano869bb802008-05-12 00:29:47944</p>
945</dd>
Junio C Hamano9572e922009-04-02 06:52:03946<dt>
947--root
948</dt>
949<dd>
950<p>
951 Treat the revision argument as a &lt;revision range&gt;, even if it
952 is just a single commit (that would normally be treated as a
953 &lt;since&gt;). Note that root commits included in the specified
954 range are always formatted as creation patches, independently
955 of this flag.
956</p>
957</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31958</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:23959</div>
Junio C Hamanoba4b9282008-07-06 05:20:31960<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamano2496ae42006-03-11 08:04:33961<div class="sectionbody">
Junio C Hamanof4581102009-04-25 08:29:59962<div class="para"><p>You can specify extra mail header lines to be added to each message,
963defaults for the subject prefix and file suffix, number patches when
Junio C Hamanoea90ab32010-03-15 20:32:55964outputting more than one patch, add "To" or "Cc:" headers, configure
965attachments, and sign off patches with configuration variables.</p></div>
Junio C Hamano7c73c662007-01-19 00:37:50966<div class="listingblock">
Junio C Hamano2496ae42006-03-11 08:04:33967<div class="content">
Junio C Hamano7c73c662007-01-19 00:37:50968<pre><tt>[format]
969 headers = "Organization: git-foo\n"
Junio C Hamano1d90cb02007-07-03 07:05:31970 subjectprefix = CHANGE
Junio C Hamano8c5802d2007-11-15 00:13:36971 suffix = .txt
Junio C Hamano2fbcd212008-05-14 22:26:07972 numbered = auto
Junio C Hamanoea90ab32010-03-15 20:32:55973 to = &lt;email&gt;
Junio C Hamano0a235222009-03-06 08:21:09974 cc = &lt;email&gt;
Junio C Hamano5f9a6f02009-04-06 08:26:56975 attach [ = mime-boundary-string ]
976 signoff = true</tt></pre>
Junio C Hamano4f9a6052007-01-17 20:25:16977</div></div>
Junio C Hamano2496ae42006-03-11 08:04:33978</div>
Junio C Hamanoba4b9282008-07-06 05:20:31979<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23980<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31981<div class="ilist"><ul>
Junio C Hamano6d76d612008-05-09 05:46:08982<li>
Junio C Hamano1a4e8412005-12-27 08:17:23983<p>
Junio C Hamano6d76d612008-05-09 05:46:08984Extract commits between revisions R1 and R2, and apply them on top of
Junio C Hamano1aa40d22010-01-21 17:46:43985the current branch using <em>git am</em> to cherry-pick them:
Junio C Hamano1a4e8412005-12-27 08:17:23986</p>
Junio C Hamano6d76d612008-05-09 05:46:08987<div class="listingblock">
988<div class="content">
Junio C Hamanoba4b9282008-07-06 05:20:31989<pre><tt>$ git format-patch -k --stdout R1..R2 | git am -3 -k</tt></pre>
Junio C Hamano6d76d612008-05-09 05:46:08990</div></div>
991</li>
992<li>
Junio C Hamano1a4e8412005-12-27 08:17:23993<p>
Junio C Hamano6d76d612008-05-09 05:46:08994Extract all commits which are in the current branch but not in the
995origin branch:
Junio C Hamano1a4e8412005-12-27 08:17:23996</p>
Junio C Hamano6d76d612008-05-09 05:46:08997<div class="listingblock">
998<div class="content">
999<pre><tt>$ git format-patch origin</tt></pre>
1000</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311001<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:081002</li>
1003<li>
Junio C Hamano7d9e9bd2007-08-29 07:31:471004<p>
Junio C Hamano6d76d612008-05-09 05:46:081005Extract all commits that lead to <em>origin</em> since the inception of the
1006project:
Junio C Hamano7d9e9bd2007-08-29 07:31:471007</p>
Junio C Hamano6d76d612008-05-09 05:46:081008<div class="listingblock">
1009<div class="content">
Junio C Hamanoba4b9282008-07-06 05:20:311010<pre><tt>$ git format-patch --root origin</tt></pre>
Junio C Hamano6d76d612008-05-09 05:46:081011</div></div>
1012</li>
1013<li>
Junio C Hamano1a4e8412005-12-27 08:17:231014<p>
Junio C Hamano6d76d612008-05-09 05:46:081015The same as the previous one:
Junio C Hamano1a4e8412005-12-27 08:17:231016</p>
Junio C Hamano6d76d612008-05-09 05:46:081017<div class="listingblock">
1018<div class="content">
1019<pre><tt>$ git format-patch -M -B origin</tt></pre>
1020</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311021<div class="para"><p>Additionally, it detects and handles renames and complete rewrites
Junio C Hamano6d76d612008-05-09 05:46:081022intelligently to produce a renaming patch. A renaming patch reduces
Junio C Hamanof4581102009-04-25 08:29:591023the amount of text output, and generally makes it easier to review.
1024Note that non-git "patch" programs won't understand renaming patches, so
Junio C Hamanoba4b9282008-07-06 05:20:311025use it only when you know the recipient uses git to apply your patch.</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081026</li>
1027<li>
Junio C Hamano7c73c662007-01-19 00:37:501028<p>
Junio C Hamano6d76d612008-05-09 05:46:081029Extract three topmost commits from the current branch and format them
1030as e-mailable patches:
Junio C Hamano7c73c662007-01-19 00:37:501031</p>
Junio C Hamano6d76d612008-05-09 05:46:081032<div class="listingblock">
1033<div class="content">
1034<pre><tt>$ git format-patch -3</tt></pre>
1035</div></div>
1036</li>
Junio C Hamanoba4b9282008-07-06 05:20:311037</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231038</div>
Junio C Hamanoba4b9282008-07-06 05:20:311039<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231040<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311041<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:231042</div>
Junio C Hamanoba4b9282008-07-06 05:20:311043<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231044<div class="sectionbody">
Junio C Hamano0868a302008-07-22 09:20:441045<div class="para"><p>Written by Junio C Hamano &lt;gitster@pobox.com&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231046</div>
Junio C Hamanoba4b9282008-07-06 05:20:311047<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231048<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311049<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:231050</div>
Junio C Hamanoba4b9282008-07-06 05:20:311051<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231052<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311053<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231054</div>
1055<div id="footer">
1056<div id="footer-text">
Junio C Hamano7d449522010-07-01 00:08:511057Last updated 2010-07-01 00:08:20 UTC
Junio C Hamano1a4e8412005-12-27 08:17:231058</div>
1059</div>
1060</body>
1061</html>