Autogenerated HTML docs for v1.7.4.1-266-ga62ea
[git/jnareb-git.git] / git-format-patch.html
blobea8f682671883fc5fcaab861f646029023ec5212
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-format-patch(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-format-patch(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-format-patch -
411 Prepare patches for e-mail submission
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git format-patch</em> [-k] [(-o|--output-directory) &lt;dir&gt; | --stdout]
419 [--no-thread | --thread[=&lt;style&gt;]]
420 [(--attach|--inline)[=&lt;boundary&gt;] | --no-attach]
421 [-s | --signoff]
422 [--signature=&lt;signature&gt; | --no-signature]
423 [-n | --numbered | -N | --no-numbered]
424 [--start-number &lt;n&gt;] [--numbered-files]
425 [--in-reply-to=Message-Id] [--suffix=.&lt;sfx&gt;]
426 [--ignore-if-in-upstream]
427 [--subject-prefix=Subject-Prefix]
428 [--to=&lt;email&gt;] [--cc=&lt;email&gt;]
429 [--cover-letter]
430 [&lt;common diff options&gt;]
431 [ &lt;since&gt; | &lt;revision range&gt; ]</div>
432 <div class="verseblock-attribution">
433 </div></div>
434 </div>
435 <h2 id="_description">DESCRIPTION</h2>
436 <div class="sectionbody">
437 <div class="paragraph"><p>Prepare each commit with its patch in
438 one file per commit, formatted to resemble UNIX mailbox format.
439 The output of this command is convenient for e-mail submission or
440 for use with <em>git am</em>.</p></div>
441 <div class="paragraph"><p>There are two ways to specify which commits to operate on.</p></div>
442 <div class="olist arabic"><ol class="arabic">
443 <li>
445 A single commit, &lt;since&gt;, specifies that the commits leading
446 to the tip of the current branch that are not in the history
447 that leads to the &lt;since&gt; to be output.
448 </p>
449 </li>
450 <li>
452 Generic &lt;revision range&gt; expression (see "SPECIFYING
453 REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>) means the
454 commits in the specified range.
455 </p>
456 </li>
457 </ol></div>
458 <div class="paragraph"><p>The first rule takes precedence in the case of a single &lt;commit&gt;. To
459 apply the second rule, i.e., format everything since the beginning of
460 history up until &lt;commit&gt;, use the <em>--root</em> option: <tt>git format-patch
461 --root &lt;commit&gt;</tt>. If you want to format only &lt;commit&gt; itself, you
462 can do this with <tt>git format-patch -1 &lt;commit&gt;</tt>.</p></div>
463 <div class="paragraph"><p>By default, each output file is numbered sequentially from 1, and uses the
464 first line of the commit message (massaged for pathname safety) as
465 the filename. With the <tt>--numbered-files</tt> option, the output file names
466 will only be numbers, without the first line of the commit appended.
467 The names of the output files are printed to standard
468 output, unless the <tt>--stdout</tt> option is specified.</p></div>
469 <div class="paragraph"><p>If <tt>-o</tt> is specified, output files are created in &lt;dir&gt;. Otherwise
470 they are created in the current working directory.</p></div>
471 <div class="paragraph"><p>By default, the subject of a single patch is "[PATCH] First Line" and
472 the subject when multiple patches are output is "[PATCH n/m] First
473 Line". To force 1/1 to be added for a single patch, use <tt>-n</tt>. To omit
474 patch numbers from the subject, use <tt>-N</tt>.</p></div>
475 <div class="paragraph"><p>If given <tt>--thread</tt>, <tt>git-format-patch</tt> will generate <tt>In-Reply-To</tt> and
476 <tt>References</tt> headers to make the second and subsequent patch mails appear
477 as replies to the first mail; this also generates a <tt>Message-Id</tt> header to
478 reference.</p></div>
479 </div>
480 <h2 id="_options">OPTIONS</h2>
481 <div class="sectionbody">
482 <div class="dlist"><dl>
483 <dt class="hdlist1">
485 </dt>
486 <dt class="hdlist1">
487 --no-stat
488 </dt>
489 <dd>
491 Generate plain patches without any diffstats.
492 </p>
493 </dd>
494 <dt class="hdlist1">
495 -U&lt;n&gt;
496 </dt>
497 <dt class="hdlist1">
498 --unified=&lt;n&gt;
499 </dt>
500 <dd>
502 Generate diffs with &lt;n&gt; lines of context instead of
503 the usual three.
504 </p>
505 </dd>
506 <dt class="hdlist1">
507 --patience
508 </dt>
509 <dd>
511 Generate a diff using the "patience diff" algorithm.
512 </p>
513 </dd>
514 <dt class="hdlist1">
515 --stat[=&lt;width&gt;[,&lt;name-width&gt;]]
516 </dt>
517 <dd>
519 Generate a diffstat. You can override the default
520 output width for 80-column terminal by <tt>--stat=&lt;width&gt;</tt>.
521 The width of the filename part can be controlled by
522 giving another width to it separated by a comma.
523 </p>
524 </dd>
525 <dt class="hdlist1">
526 --numstat
527 </dt>
528 <dd>
530 Similar to <tt>--stat</tt>, but shows number of added and
531 deleted lines in decimal notation and pathname without
532 abbreviation, to make it more machine friendly. For
533 binary files, outputs two <tt>-</tt> instead of saying
534 <tt>0 0</tt>.
535 </p>
536 </dd>
537 <dt class="hdlist1">
538 --shortstat
539 </dt>
540 <dd>
542 Output only the last line of the <tt>--stat</tt> format containing total
543 number of modified files, as well as number of added and deleted
544 lines.
545 </p>
546 </dd>
547 <dt class="hdlist1">
548 --dirstat[=&lt;limit&gt;]
549 </dt>
550 <dd>
552 Output the distribution of relative amount of changes (number of lines added or
553 removed) for each sub-directory. Directories with changes below
554 a cut-off percent (3% by default) are not shown. The cut-off percent
555 can be set with <tt>--dirstat=&lt;limit&gt;</tt>. Changes in a child directory are not
556 counted for the parent directory, unless <tt>--cumulative</tt> is used.
557 </p>
558 </dd>
559 <dt class="hdlist1">
560 --dirstat-by-file[=&lt;limit&gt;]
561 </dt>
562 <dd>
564 Same as <tt>--dirstat</tt>, but counts changed files instead of lines.
565 </p>
566 </dd>
567 <dt class="hdlist1">
568 --summary
569 </dt>
570 <dd>
572 Output a condensed summary of extended header information
573 such as creations, renames and mode changes.
574 </p>
575 </dd>
576 <dt class="hdlist1">
577 --no-renames
578 </dt>
579 <dd>
581 Turn off rename detection, even when the configuration
582 file gives the default to do so.
583 </p>
584 </dd>
585 <dt class="hdlist1">
586 --full-index
587 </dt>
588 <dd>
590 Instead of the first handful of characters, show the full
591 pre- and post-image blob object names on the "index"
592 line when generating patch format output.
593 </p>
594 </dd>
595 <dt class="hdlist1">
596 --binary
597 </dt>
598 <dd>
600 In addition to <tt>--full-index</tt>, output a binary diff that
601 can be applied with <tt>git-apply</tt>.
602 </p>
603 </dd>
604 <dt class="hdlist1">
605 --abbrev[=&lt;n&gt;]
606 </dt>
607 <dd>
609 Instead of showing the full 40-byte hexadecimal object
610 name in diff-raw format output and diff-tree header
611 lines, show only a partial prefix. This is
612 independent of the <tt>--full-index</tt> option above, which controls
613 the diff-patch output format. Non default number of
614 digits can be specified with <tt>--abbrev=&lt;n&gt;</tt>.
615 </p>
616 </dd>
617 <dt class="hdlist1">
618 -B[&lt;n&gt;][/&lt;m&gt;]
619 </dt>
620 <dt class="hdlist1">
621 --break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
622 </dt>
623 <dd>
625 Break complete rewrite changes into pairs of delete and
626 create. This serves two purposes:
627 </p>
628 <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
629 not as a series of deletion and insertion mixed together with a very
630 few lines that happen to match textually as the context, but as a
631 single deletion of everything old followed by a single insertion of
632 everything new, and the number <tt>m</tt> controls this aspect of the -B
633 option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the
634 original should remain in the result for git to consider it a total
635 rewrite (i.e. otherwise the resulting patch will be a series of
636 deletion and insertion mixed together with context lines).</p></div>
637 <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
638 source of a rename (usually -M only considers a file that disappeared
639 as the source of a rename), and the number <tt>n</tt> controls this aspect of
640 the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with
641 addition and deletion compared to 20% or more of the file&#8217;s size are
642 eligible for being picked up as a possible source of a rename to
643 another file.</p></div>
644 </dd>
645 <dt class="hdlist1">
646 -M[&lt;n&gt;]
647 </dt>
648 <dt class="hdlist1">
649 --find-renames[=&lt;n&gt;]
650 </dt>
651 <dd>
653 Detect renames.
654 If <tt>n</tt> is specified, it is a is a threshold on the similarity
655 index (i.e. amount of addition/deletions compared to the
656 file&#8217;s size). For example, <tt>-M90%</tt> means git should consider a
657 delete/add pair to be a rename if more than 90% of the file
658 hasn&#8217;t changed.
659 </p>
660 </dd>
661 <dt class="hdlist1">
662 -C[&lt;n&gt;]
663 </dt>
664 <dt class="hdlist1">
665 --find-copies[=&lt;n&gt;]
666 </dt>
667 <dd>
669 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
670 If <tt>n</tt> is specified, it has the same meaning as for <tt>-M&lt;n&gt;</tt>.
671 </p>
672 </dd>
673 <dt class="hdlist1">
674 --find-copies-harder
675 </dt>
676 <dd>
678 For performance reasons, by default, <tt>-C</tt> option finds copies only
679 if the original file of the copy was modified in the same
680 changeset. This flag makes the command
681 inspect unmodified files as candidates for the source of
682 copy. This is a very expensive operation for large
683 projects, so use it with caution. Giving more than one
684 <tt>-C</tt> option has the same effect.
685 </p>
686 </dd>
687 <dt class="hdlist1">
688 -l&lt;num&gt;
689 </dt>
690 <dd>
692 The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n
693 is the number of potential rename/copy targets. This
694 option prevents rename/copy detection from running if
695 the number of rename/copy targets exceeds the specified
696 number.
697 </p>
698 </dd>
699 <dt class="hdlist1">
700 -O&lt;orderfile&gt;
701 </dt>
702 <dd>
704 Output the patch in the order specified in the
705 &lt;orderfile&gt;, which has one shell glob pattern per line.
706 </p>
707 </dd>
708 <dt class="hdlist1">
710 </dt>
711 <dt class="hdlist1">
712 --text
713 </dt>
714 <dd>
716 Treat all files as text.
717 </p>
718 </dd>
719 <dt class="hdlist1">
720 --ignore-space-at-eol
721 </dt>
722 <dd>
724 Ignore changes in whitespace at EOL.
725 </p>
726 </dd>
727 <dt class="hdlist1">
729 </dt>
730 <dt class="hdlist1">
731 --ignore-space-change
732 </dt>
733 <dd>
735 Ignore changes in amount of whitespace. This ignores whitespace
736 at line end, and considers all other sequences of one or
737 more whitespace characters to be equivalent.
738 </p>
739 </dd>
740 <dt class="hdlist1">
742 </dt>
743 <dt class="hdlist1">
744 --ignore-all-space
745 </dt>
746 <dd>
748 Ignore whitespace when comparing lines. This ignores
749 differences even if one line has whitespace where the other
750 line has none.
751 </p>
752 </dd>
753 <dt class="hdlist1">
754 --inter-hunk-context=&lt;lines&gt;
755 </dt>
756 <dd>
758 Show the context between diff hunks, up to the specified number
759 of lines, thereby fusing hunks that are close to each other.
760 </p>
761 </dd>
762 <dt class="hdlist1">
763 --ext-diff
764 </dt>
765 <dd>
767 Allow an external diff helper to be executed. If you set an
768 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
769 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
770 </p>
771 </dd>
772 <dt class="hdlist1">
773 --no-ext-diff
774 </dt>
775 <dd>
777 Disallow external diff drivers.
778 </p>
779 </dd>
780 <dt class="hdlist1">
781 --ignore-submodules[=&lt;when&gt;]
782 </dt>
783 <dd>
785 Ignore changes to submodules in the diff generation. &lt;when&gt; can be
786 either "none", "untracked", "dirty" or "all", which is the default
787 Using "none" will consider the submodule modified when it either contains
788 untracked or modified files or its HEAD differs from the commit recorded
789 in the superproject and can be used to override any settings of the
790 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
791 "untracked" is used submodules are not considered dirty when they only
792 contain untracked content (but they are still scanned for modified
793 content). Using "dirty" ignores all changes to the work tree of submodules,
794 only changes to the commits stored in the superproject are shown (this was
795 the behavior until 1.7.0). Using "all" hides all changes to submodules.
796 </p>
797 </dd>
798 <dt class="hdlist1">
799 --src-prefix=&lt;prefix&gt;
800 </dt>
801 <dd>
803 Show the given source prefix instead of "a/".
804 </p>
805 </dd>
806 <dt class="hdlist1">
807 --dst-prefix=&lt;prefix&gt;
808 </dt>
809 <dd>
811 Show the given destination prefix instead of "b/".
812 </p>
813 </dd>
814 <dt class="hdlist1">
815 --no-prefix
816 </dt>
817 <dd>
819 Do not show any source or destination prefix.
820 </p>
821 </dd>
822 </dl></div>
823 <div class="paragraph"><p>For more detailed explanation on these common options, see also
824 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
825 <div class="dlist"><dl>
826 <dt class="hdlist1">
827 -&lt;n&gt;
828 </dt>
829 <dd>
831 Prepare patches from the topmost &lt;n&gt; commits.
832 </p>
833 </dd>
834 <dt class="hdlist1">
835 -o &lt;dir&gt;
836 </dt>
837 <dt class="hdlist1">
838 --output-directory &lt;dir&gt;
839 </dt>
840 <dd>
842 Use &lt;dir&gt; to store the resulting files, instead of the
843 current working directory.
844 </p>
845 </dd>
846 <dt class="hdlist1">
848 </dt>
849 <dt class="hdlist1">
850 --numbered
851 </dt>
852 <dd>
854 Name output in <em>[PATCH n/m]</em> format, even with a single patch.
855 </p>
856 </dd>
857 <dt class="hdlist1">
859 </dt>
860 <dt class="hdlist1">
861 --no-numbered
862 </dt>
863 <dd>
865 Name output in <em>[PATCH]</em> format.
866 </p>
867 </dd>
868 <dt class="hdlist1">
869 --start-number &lt;n&gt;
870 </dt>
871 <dd>
873 Start numbering the patches at &lt;n&gt; instead of 1.
874 </p>
875 </dd>
876 <dt class="hdlist1">
877 --numbered-files
878 </dt>
879 <dd>
881 Output file names will be a simple number sequence
882 without the default first line of the commit appended.
883 </p>
884 </dd>
885 <dt class="hdlist1">
887 </dt>
888 <dt class="hdlist1">
889 --keep-subject
890 </dt>
891 <dd>
893 Do not strip/add <em>[PATCH]</em> from the first line of the
894 commit log message.
895 </p>
896 </dd>
897 <dt class="hdlist1">
899 </dt>
900 <dt class="hdlist1">
901 --signoff
902 </dt>
903 <dd>
905 Add <tt>Signed-off-by:</tt> line to the commit message, using
906 the committer identity of yourself.
907 </p>
908 </dd>
909 <dt class="hdlist1">
910 --stdout
911 </dt>
912 <dd>
914 Print all commits to the standard output in mbox format,
915 instead of creating a file for each one.
916 </p>
917 </dd>
918 <dt class="hdlist1">
919 --attach[=&lt;boundary&gt;]
920 </dt>
921 <dd>
923 Create multipart/mixed attachment, the first part of
924 which is the commit message and the patch itself in the
925 second part, with <tt>Content-Disposition: attachment</tt>.
926 </p>
927 </dd>
928 <dt class="hdlist1">
929 --no-attach
930 </dt>
931 <dd>
933 Disable the creation of an attachment, overriding the
934 configuration setting.
935 </p>
936 </dd>
937 <dt class="hdlist1">
938 --inline[=&lt;boundary&gt;]
939 </dt>
940 <dd>
942 Create multipart/mixed attachment, the first part of
943 which is the commit message and the patch itself in the
944 second part, with <tt>Content-Disposition: inline</tt>.
945 </p>
946 </dd>
947 <dt class="hdlist1">
948 --thread[=&lt;style&gt;]
949 </dt>
950 <dt class="hdlist1">
951 --no-thread
952 </dt>
953 <dd>
955 Controls addition of <tt>In-Reply-To</tt> and <tt>References</tt> headers to
956 make the second and subsequent mails appear as replies to the
957 first. Also controls generation of the <tt>Message-Id</tt> header to
958 reference.
959 </p>
960 <div class="paragraph"><p>The optional &lt;style&gt; argument can be either <tt>shallow</tt> or <tt>deep</tt>.
961 <em>shallow</em> threading makes every mail a reply to the head of the
962 series, where the head is chosen from the cover letter, the
963 <tt>--in-reply-to</tt>, and the first patch mail, in this order. <em>deep</em>
964 threading makes every mail a reply to the previous one.</p></div>
965 <div class="paragraph"><p>The default is <tt>--no-thread</tt>, unless the <em>format.thread</em> configuration
966 is set. If <tt>--thread</tt> is specified without a style, it defaults to the
967 style specified by <em>format.thread</em> if any, or else <tt>shallow</tt>.</p></div>
968 <div class="paragraph"><p>Beware that the default for <em>git send-email</em> is to thread emails
969 itself. If you want <tt>git format-patch</tt> to take care of threading, you
970 will want to ensure that threading is disabled for <tt>git send-email</tt>.</p></div>
971 </dd>
972 <dt class="hdlist1">
973 --in-reply-to=Message-Id
974 </dt>
975 <dd>
977 Make the first mail (or all the mails with <tt>--no-thread</tt>) appear as a
978 reply to the given Message-Id, which avoids breaking threads to
979 provide a new patch series.
980 </p>
981 </dd>
982 <dt class="hdlist1">
983 --ignore-if-in-upstream
984 </dt>
985 <dd>
987 Do not include a patch that matches a commit in
988 &lt;until&gt;..&lt;since&gt;. This will examine all patches reachable
989 from &lt;since&gt; but not from &lt;until&gt; and compare them with the
990 patches being generated, and any patch that matches is
991 ignored.
992 </p>
993 </dd>
994 <dt class="hdlist1">
995 --subject-prefix=&lt;Subject-Prefix&gt;
996 </dt>
997 <dd>
999 Instead of the standard <em>[PATCH]</em> prefix in the subject
1000 line, instead use <em>[&lt;Subject-Prefix&gt;]</em>. This
1001 allows for useful naming of a patch series, and can be
1002 combined with the <tt>--numbered</tt> option.
1003 </p>
1004 </dd>
1005 <dt class="hdlist1">
1006 --to=&lt;email&gt;
1007 </dt>
1008 <dd>
1010 Add a <tt>To:</tt> header to the email headers. This is in addition
1011 to any configured headers, and may be used multiple times.
1012 </p>
1013 </dd>
1014 <dt class="hdlist1">
1015 --cc=&lt;email&gt;
1016 </dt>
1017 <dd>
1019 Add a <tt>Cc:</tt> header to the email headers. This is in addition
1020 to any configured headers, and may be used multiple times.
1021 </p>
1022 </dd>
1023 <dt class="hdlist1">
1024 --add-header=&lt;header&gt;
1025 </dt>
1026 <dd>
1028 Add an arbitrary header to the email headers. This is in addition
1029 to any configured headers, and may be used multiple times.
1030 For example, <tt>--add-header="Organization: git-foo"</tt>
1031 </p>
1032 </dd>
1033 <dt class="hdlist1">
1034 --cover-letter
1035 </dt>
1036 <dd>
1038 In addition to the patches, generate a cover letter file
1039 containing the shortlog and the overall diffstat. You can
1040 fill in a description in the file before sending it out.
1041 </p>
1042 </dd>
1043 <dt class="hdlist1">
1044 --[no]-signature=&lt;signature&gt;
1045 </dt>
1046 <dd>
1048 Add a signature to each message produced. Per RFC 3676 the signature
1049 is separated from the body by a line with '-- ' on it. If the
1050 signature option is omitted the signature defaults to the git version
1051 number.
1052 </p>
1053 </dd>
1054 <dt class="hdlist1">
1055 --suffix=.&lt;sfx&gt;
1056 </dt>
1057 <dd>
1059 Instead of using <tt>.patch</tt> as the suffix for generated
1060 filenames, use specified suffix. A common alternative is
1061 <tt>--suffix=.txt</tt>. Leaving this empty will remove the <tt>.patch</tt>
1062 suffix.
1063 </p>
1064 <div class="paragraph"><p>Note that the leading character does not have to be a dot; for example,
1065 you can use <tt>--suffix=-patch</tt> to get <tt>0001-description-of-my-change-patch</tt>.</p></div>
1066 </dd>
1067 <dt class="hdlist1">
1068 --no-binary
1069 </dt>
1070 <dd>
1072 Do not output contents of changes in binary files, instead
1073 display a notice that those files changed. Patches generated
1074 using this option cannot be applied properly, but they are
1075 still useful for code review.
1076 </p>
1077 </dd>
1078 <dt class="hdlist1">
1079 --root
1080 </dt>
1081 <dd>
1083 Treat the revision argument as a &lt;revision range&gt;, even if it
1084 is just a single commit (that would normally be treated as a
1085 &lt;since&gt;). Note that root commits included in the specified
1086 range are always formatted as creation patches, independently
1087 of this flag.
1088 </p>
1089 </dd>
1090 </dl></div>
1091 </div>
1092 <h2 id="_configuration">CONFIGURATION</h2>
1093 <div class="sectionbody">
1094 <div class="paragraph"><p>You can specify extra mail header lines to be added to each message,
1095 defaults for the subject prefix and file suffix, number patches when
1096 outputting more than one patch, add "To" or "Cc:" headers, configure
1097 attachments, and sign off patches with configuration variables.</p></div>
1098 <div class="listingblock">
1099 <div class="content">
1100 <pre><tt>[format]
1101 headers = "Organization: git-foo\n"
1102 subjectprefix = CHANGE
1103 suffix = .txt
1104 numbered = auto
1105 to = &lt;email&gt;
1106 cc = &lt;email&gt;
1107 attach [ = mime-boundary-string ]
1108 signoff = true</tt></pre>
1109 </div></div>
1110 </div>
1111 <h2 id="_examples">EXAMPLES</h2>
1112 <div class="sectionbody">
1113 <div class="ulist"><ul>
1114 <li>
1116 Extract commits between revisions R1 and R2, and apply them on top of
1117 the current branch using <em>git am</em> to cherry-pick them:
1118 </p>
1119 <div class="listingblock">
1120 <div class="content">
1121 <pre><tt>$ git format-patch -k --stdout R1..R2 | git am -3 -k</tt></pre>
1122 </div></div>
1123 </li>
1124 <li>
1126 Extract all commits which are in the current branch but not in the
1127 origin branch:
1128 </p>
1129 <div class="listingblock">
1130 <div class="content">
1131 <pre><tt>$ git format-patch origin</tt></pre>
1132 </div></div>
1133 <div class="paragraph"><p>For each commit a separate file is created in the current directory.</p></div>
1134 </li>
1135 <li>
1137 Extract all commits that lead to <em>origin</em> since the inception of the
1138 project:
1139 </p>
1140 <div class="listingblock">
1141 <div class="content">
1142 <pre><tt>$ git format-patch --root origin</tt></pre>
1143 </div></div>
1144 </li>
1145 <li>
1147 The same as the previous one:
1148 </p>
1149 <div class="listingblock">
1150 <div class="content">
1151 <pre><tt>$ git format-patch -M -B origin</tt></pre>
1152 </div></div>
1153 <div class="paragraph"><p>Additionally, it detects and handles renames and complete rewrites
1154 intelligently to produce a renaming patch. A renaming patch reduces
1155 the amount of text output, and generally makes it easier to review.
1156 Note that non-git "patch" programs won&#8217;t understand renaming patches, so
1157 use it only when you know the recipient uses git to apply your patch.</p></div>
1158 </li>
1159 <li>
1161 Extract three topmost commits from the current branch and format them
1162 as e-mailable patches:
1163 </p>
1164 <div class="listingblock">
1165 <div class="content">
1166 <pre><tt>$ git format-patch -3</tt></pre>
1167 </div></div>
1168 </li>
1169 </ul></div>
1170 </div>
1171 <h2 id="_see_also">SEE ALSO</h2>
1172 <div class="sectionbody">
1173 <div class="paragraph"><p><a href="git-am.html">git-am(1)</a>, <a href="git-send-email.html">git-send-email(1)</a></p></div>
1174 </div>
1175 <h2 id="_git">GIT</h2>
1176 <div class="sectionbody">
1177 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1178 </div>
1179 <div id="footer">
1180 <div id="footer-text">
1181 Last updated 2011-03-15 23:30:13 UTC
1182 </div>
1183 </div>
1184 </body>
1185 </html>