Autogenerated HTML docs for v1.6.3.2-214-gf4f78
[git/jnareb-git.git] / git-format-patch.html
blob885849ecd3eb730a6380103ab883d6479e3be289
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.2.5" />
7 <style type="text/css">
8 /* Debug borders */
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border: 1px solid red;
15 body {
16 margin: 1em 5% 1em 5%;
19 a {
20 color: blue;
21 text-decoration: underline;
23 a:visited {
24 color: fuchsia;
27 em {
28 font-style: italic;
31 strong {
32 font-weight: bold;
35 tt {
36 color: navy;
39 h1, 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;
47 h1, h2, h3 {
48 border-bottom: 2px solid silver;
50 h2 {
51 padding-top: 0.5em;
53 h3 {
54 float: left;
56 h3 + * {
57 clear: left;
60 div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
65 hr {
66 border: 1px solid silver;
69 p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
74 pre {
75 padding: 0;
76 margin: 0;
79 span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
83 font-size: 1.1em;
85 span#email {
87 span#revision {
88 font-family: sans-serif;
91 div#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;
98 div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
102 div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
107 div#preamble,
108 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110 div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
115 div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
120 div.content { /* Block element content. */
121 padding: 0;
124 /* Block element titles. */
125 div.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;
132 div.title + * {
133 margin-top: 0;
136 td div.title:first-child {
137 margin-top: 0.0em;
139 div.content div.title:first-child {
140 margin-top: 0.0em;
142 div.content + div.title {
143 margin-top: 0.0em;
146 div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
152 div.listingblock {
153 margin-right: 0%;
155 div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
161 div.quoteblock > div.content {
162 padding-left: 2.0em;
165 div.attribution {
166 text-align: right;
168 div.verseblock + div.attribution {
169 text-align: left;
172 div.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;
180 div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
185 div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
190 div.verseblock div.content {
191 white-space: pre;
194 div.imageblock div.content { padding-left: 0; }
195 div.imageblock img { border: 1px solid silver; }
196 span.image img { border-style: none; }
198 dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
202 dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
207 dd > *:first-child {
208 margin-top: 0;
211 ul, ol {
212 list-style-position: outside;
214 div.olist2 ol {
215 list-style-type: lower-alpha;
218 div.tableblock > table {
219 border: 3px solid #527bbd;
221 thead {
222 font-family: sans-serif;
223 font-weight: bold;
225 tfoot {
226 font-weight: bold;
229 div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
233 div.hlist td {
234 padding-bottom: 5px;
236 td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
241 td.hlist2 {
242 vertical-align: top;
245 @media print {
246 div#footer-badges { display: none; }
249 div#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;
258 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
262 div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
266 div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
270 div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
274 include1::./stylesheets/xhtml11-manpage.css[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
282 div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
289 div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
295 div.quoteblock-content {
296 padding-left: 2.0em;
299 div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc a:visited { color: blue; }
306 </style>
307 <title>git-format-patch(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-format-patch(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-format-patch -
317 Prepare patches for e-mail submission
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="verseblock">
324 <div class="content"><em>git format-patch</em> [-k] [(-o|--output-directory) &lt;dir&gt; | --stdout]
325 [--thread[=&lt;style&gt;]]
326 [(--attach|--inline)[=&lt;boundary&gt;] | --no-attach]
327 [-s | --signoff]
328 [-n | --numbered | -N | --no-numbered]
329 [--start-number &lt;n&gt;] [--numbered-files]
330 [--in-reply-to=Message-Id] [--suffix=.&lt;sfx&gt;]
331 [--ignore-if-in-upstream]
332 [--subject-prefix=Subject-Prefix]
333 [--cc=&lt;email&gt;]
334 [--cover-letter]
335 [&lt;common diff options&gt;]
336 [ &lt;since&gt; | &lt;revision range&gt; ]</div></div>
337 </div>
338 <h2 id="_description">DESCRIPTION</h2>
339 <div class="sectionbody">
340 <div class="para"><p>Prepare each commit with its patch in
341 one file per commit, formatted to resemble UNIX mailbox format.
342 The output of this command is convenient for e-mail submission or
343 for use with <em>git-am</em>.</p></div>
344 <div class="para"><p>There are two ways to specify which commits to operate on.</p></div>
345 <div class="olist"><ol>
346 <li>
348 A single commit, &lt;since&gt;, specifies that the commits leading
349 to the tip of the current branch that are not in the history
350 that leads to the &lt;since&gt; to be output.
351 </p>
352 </li>
353 <li>
355 Generic &lt;revision range&gt; expression (see "SPECIFYING
356 REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>) means the
357 commits in the specified range.
358 </p>
359 </li>
360 </ol></div>
361 <div class="para"><p>The first rule takes precedence in the case of a single &lt;commit&gt;. To
362 apply the second rule, i.e., format everything since the beginning of
363 history up until &lt;commit&gt;, use the <em>--root</em> option: "git format-patch
364 --root &lt;commit&gt;". If you want to format only &lt;commit&gt; itself, you
365 can do this with "git format-patch -1 &lt;commit&gt;".</p></div>
366 <div class="para"><p>By default, each output file is numbered sequentially from 1, and uses the
367 first line of the commit message (massaged for pathname safety) as
368 the filename. With the --numbered-files option, the output file names
369 will only be numbers, without the first line of the commit appended.
370 The names of the output files are printed to standard
371 output, unless the --stdout option is specified.</p></div>
372 <div class="para"><p>If -o is specified, output files are created in &lt;dir&gt;. Otherwise
373 they are created in the current working directory.</p></div>
374 <div class="para"><p>By default, the subject of a single patch is "[PATCH] First Line" and
375 the subject when multiple patches are output is "[PATCH n/m] First
376 Line". To force 1/1 to be added for a single patch, use -n. To omit
377 patch numbers from the subject, use -N</p></div>
378 <div class="para"><p>If given --thread, <em>git-format-patch</em> will generate In-Reply-To and
379 References headers to make the second and subsequent patch mails appear
380 as replies to the first mail; this also generates a Message-Id header to
381 reference.</p></div>
382 </div>
383 <h2 id="_options">OPTIONS</h2>
384 <div class="sectionbody">
385 <div class="vlist"><dl>
386 <dt>
388 </dt>
389 <dd>
391 Generate patches without diffstat.
392 </p>
393 </dd>
394 <dt>
395 -U&lt;n&gt;
396 </dt>
397 <dt>
398 --unified=&lt;n&gt;
399 </dt>
400 <dd>
402 Generate diffs with &lt;n&gt; lines of context instead of
403 the usual three. Implies "-p".
404 </p>
405 </dd>
406 <dt>
407 --raw
408 </dt>
409 <dd>
411 Generate the raw format.
413 </p>
414 </dd>
415 <dt>
416 --patch-with-raw
417 </dt>
418 <dd>
420 Synonym for "-p --raw".
421 </p>
422 </dd>
423 <dt>
424 --patience
425 </dt>
426 <dd>
428 Generate a diff using the "patience diff" algorithm.
429 </p>
430 </dd>
431 <dt>
432 --stat[=width[,name-width]]
433 </dt>
434 <dd>
436 Generate a diffstat. You can override the default
437 output width for 80-column terminal by "--stat=width".
438 The width of the filename part can be controlled by
439 giving another width to it separated by a comma.
440 </p>
441 </dd>
442 <dt>
443 --numstat
444 </dt>
445 <dd>
447 Similar to --stat, but shows number of added and
448 deleted lines in decimal notation and pathname without
449 abbreviation, to make it more machine friendly. For
450 binary files, outputs two <tt>-</tt> instead of saying
451 <tt>0 0</tt>.
452 </p>
453 </dd>
454 <dt>
455 --shortstat
456 </dt>
457 <dd>
459 Output only the last line of the --stat format containing total
460 number of modified files, as well as number of added and deleted
461 lines.
462 </p>
463 </dd>
464 <dt>
465 --dirstat[=limit]
466 </dt>
467 <dd>
469 Output the distribution of relative amount of changes (number of lines added or
470 removed) for each sub-directory. Directories with changes below
471 a cut-off percent (3% by default) are not shown. The cut-off percent
472 can be set with "--dirstat=limit". Changes in a child directory is not
473 counted for the parent directory, unless "--cumulative" is used.
474 </p>
475 </dd>
476 <dt>
477 --dirstat-by-file[=limit]
478 </dt>
479 <dd>
481 Same as --dirstat, but counts changed files instead of lines.
482 </p>
483 </dd>
484 <dt>
485 --summary
486 </dt>
487 <dd>
489 Output a condensed summary of extended header information
490 such as creations, renames and mode changes.
491 </p>
492 </dd>
493 <dt>
494 --patch-with-stat
495 </dt>
496 <dd>
498 Synonym for "-p --stat".
499 This is the default.
500 </p>
501 </dd>
502 <dt>
504 </dt>
505 <dd>
507 NUL-line termination on output. This affects the --raw
508 output field terminator. Also output from commands such
509 as "git-log" will be delimited with NUL between commits.
510 </p>
511 </dd>
512 <dt>
513 --name-only
514 </dt>
515 <dd>
517 Show only names of changed files.
518 </p>
519 </dd>
520 <dt>
521 --name-status
522 </dt>
523 <dd>
525 Show only names and status of changed files. See the description
526 of the <tt>--diff-filter</tt> option on what the status letters mean.
527 </p>
528 </dd>
529 <dt>
530 --color
531 </dt>
532 <dd>
534 Show colored diff.
535 </p>
536 </dd>
537 <dt>
538 --no-color
539 </dt>
540 <dd>
542 Turn off colored diff, even when the configuration file
543 gives the default to color output.
544 </p>
545 </dd>
546 <dt>
547 --color-words[=&lt;regex&gt;]
548 </dt>
549 <dd>
551 Show colored word diff, i.e., color words which have changed.
552 By default, words are separated by whitespace.
553 </p>
554 <div class="para"><p>When a &lt;regex&gt; is specified, every non-overlapping match of the
555 &lt;regex&gt; is considered a word. Anything between these matches is
556 considered whitespace and ignored(!) for the purposes of finding
557 differences. You may want to append <tt>|[^[:space:]]</tt> to your regular
558 expression to make sure that it matches all non-whitespace characters.
559 A match that contains a newline is silently truncated(!) at the
560 newline.</p></div>
561 <div class="para"><p>The regex can also be set via a diff driver or configuration option, see
562 <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
563 overrides any diff driver or configuration setting. Diff drivers
564 override configuration settings.</p></div>
565 </dd>
566 <dt>
567 --no-renames
568 </dt>
569 <dd>
571 Turn off rename detection, even when the configuration
572 file gives the default to do so.
573 </p>
574 </dd>
575 <dt>
576 --check
577 </dt>
578 <dd>
580 Warn if changes introduce trailing whitespace
581 or an indent that uses a space before a tab. Exits with
582 non-zero status if problems are found. Not compatible with
583 --exit-code.
584 </p>
585 </dd>
586 <dt>
587 --full-index
588 </dt>
589 <dd>
591 Instead of the first handful of characters, show the full
592 pre- and post-image blob object names on the "index"
593 line when generating patch format output.
594 </p>
595 </dd>
596 <dt>
597 --binary
598 </dt>
599 <dd>
601 In addition to --full-index, output "binary diff" that
602 can be applied with "git apply".
603 </p>
604 </dd>
605 <dt>
606 --abbrev[=&lt;n&gt;]
607 </dt>
608 <dd>
610 Instead of showing the full 40-byte hexadecimal object
611 name in diff-raw format output and diff-tree header
612 lines, show only a partial prefix. This is
613 independent of --full-index option above, which controls
614 the diff-patch output format. Non default number of
615 digits can be specified with --abbrev=&lt;n&gt;.
616 </p>
617 </dd>
618 <dt>
620 </dt>
621 <dd>
623 Break complete rewrite changes into pairs of delete and create.
624 </p>
625 </dd>
626 <dt>
628 </dt>
629 <dd>
631 Detect renames.
632 </p>
633 </dd>
634 <dt>
636 </dt>
637 <dd>
639 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
640 </p>
641 </dd>
642 <dt>
643 --diff-filter=[ACDMRTUXB*]
644 </dt>
645 <dd>
647 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
648 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
649 type (i.e. regular file, symlink, submodule, &#8230;) changed (<tt>T</tt>),
650 are Unmerged (<tt>U</tt>), are
651 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
652 Any combination of the filter characters may be used.
653 When <tt>*</tt> (All-or-none) is added to the combination, all
654 paths are selected if there is any file that matches
655 other criteria in the comparison; if there is no file
656 that matches other criteria, nothing is selected.
657 </p>
658 </dd>
659 <dt>
660 --find-copies-harder
661 </dt>
662 <dd>
664 For performance reasons, by default, <tt>-C</tt> option finds copies only
665 if the original file of the copy was modified in the same
666 changeset. This flag makes the command
667 inspect unmodified files as candidates for the source of
668 copy. This is a very expensive operation for large
669 projects, so use it with caution. Giving more than one
670 <tt>-C</tt> option has the same effect.
671 </p>
672 </dd>
673 <dt>
674 -l&lt;num&gt;
675 </dt>
676 <dd>
678 -M and -C options require O(n^2) processing time where n
679 is the number of potential rename/copy targets. This
680 option prevents rename/copy detection from running if
681 the number of rename/copy targets exceeds the specified
682 number.
683 </p>
684 </dd>
685 <dt>
686 -S&lt;string&gt;
687 </dt>
688 <dd>
690 Look for differences that introduce or remove an instance of
691 &lt;string&gt;. Note that this is different than the string simply
692 appearing in diff output; see the <em>pickaxe</em> entry in
693 <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details.
694 </p>
695 </dd>
696 <dt>
697 --pickaxe-all
698 </dt>
699 <dd>
701 When -S finds a change, show all the changes in that
702 changeset, not just the files that contain the change
703 in &lt;string&gt;.
704 </p>
705 </dd>
706 <dt>
707 --pickaxe-regex
708 </dt>
709 <dd>
711 Make the &lt;string&gt; not a plain string but an extended POSIX
712 regex to match.
713 </p>
714 </dd>
715 <dt>
716 -O&lt;orderfile&gt;
717 </dt>
718 <dd>
720 Output the patch in the order specified in the
721 &lt;orderfile&gt;, which has one shell glob pattern per line.
722 </p>
723 </dd>
724 <dt>
726 </dt>
727 <dd>
729 Swap two inputs; that is, show differences from index or
730 on-disk file to tree contents.
731 </p>
732 </dd>
733 <dt>
734 --relative[=&lt;path&gt;]
735 </dt>
736 <dd>
738 When run from a subdirectory of the project, it can be
739 told to exclude changes outside the directory and show
740 pathnames relative to it with this option. When you are
741 not in a subdirectory (e.g. in a bare repository), you
742 can name which subdirectory to make the output relative
743 to by giving a &lt;path&gt; as an argument.
744 </p>
745 </dd>
746 <dt>
748 </dt>
749 <dt>
750 --text
751 </dt>
752 <dd>
754 Treat all files as text.
755 </p>
756 </dd>
757 <dt>
758 --ignore-space-at-eol
759 </dt>
760 <dd>
762 Ignore changes in whitespace at EOL.
763 </p>
764 </dd>
765 <dt>
767 </dt>
768 <dt>
769 --ignore-space-change
770 </dt>
771 <dd>
773 Ignore changes in amount of whitespace. This ignores whitespace
774 at line end, and considers all other sequences of one or
775 more whitespace characters to be equivalent.
776 </p>
777 </dd>
778 <dt>
780 </dt>
781 <dt>
782 --ignore-all-space
783 </dt>
784 <dd>
786 Ignore whitespace when comparing lines. This ignores
787 differences even if one line has whitespace where the other
788 line has none.
789 </p>
790 </dd>
791 <dt>
792 --inter-hunk-context=&lt;lines&gt;
793 </dt>
794 <dd>
796 Show the context between diff hunks, up to the specified number
797 of lines, thereby fusing hunks that are close to each other.
798 </p>
799 </dd>
800 <dt>
801 --exit-code
802 </dt>
803 <dd>
805 Make the program exit with codes similar to diff(1).
806 That is, it exits with 1 if there were differences and
807 0 means no differences.
808 </p>
809 </dd>
810 <dt>
811 --quiet
812 </dt>
813 <dd>
815 Disable all output of the program. Implies --exit-code.
816 </p>
817 </dd>
818 <dt>
819 --ext-diff
820 </dt>
821 <dd>
823 Allow an external diff helper to be executed. If you set an
824 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
825 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
826 </p>
827 </dd>
828 <dt>
829 --no-ext-diff
830 </dt>
831 <dd>
833 Disallow external diff drivers.
834 </p>
835 </dd>
836 <dt>
837 --ignore-submodules
838 </dt>
839 <dd>
841 Ignore changes to submodules in the diff generation.
842 </p>
843 </dd>
844 <dt>
845 --src-prefix=&lt;prefix&gt;
846 </dt>
847 <dd>
849 Show the given source prefix instead of "a/".
850 </p>
851 </dd>
852 <dt>
853 --dst-prefix=&lt;prefix&gt;
854 </dt>
855 <dd>
857 Show the given destination prefix instead of "b/".
858 </p>
859 </dd>
860 <dt>
861 --no-prefix
862 </dt>
863 <dd>
865 Do not show any source or destination prefix.
866 </p>
867 </dd>
868 </dl></div>
869 <div class="para"><p>For more detailed explanation on these common options, see also
870 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
871 <div class="vlist"><dl>
872 <dt>
873 -&lt;n&gt;
874 </dt>
875 <dd>
877 Limits the number of patches to prepare.
878 </p>
879 </dd>
880 <dt>
881 -o &lt;dir&gt;
882 </dt>
883 <dt>
884 --output-directory &lt;dir&gt;
885 </dt>
886 <dd>
888 Use &lt;dir&gt; to store the resulting files, instead of the
889 current working directory.
890 </p>
891 </dd>
892 <dt>
894 </dt>
895 <dt>
896 --numbered
897 </dt>
898 <dd>
900 Name output in <em>[PATCH n/m]</em> format, even with a single patch.
901 </p>
902 </dd>
903 <dt>
905 </dt>
906 <dt>
907 --no-numbered
908 </dt>
909 <dd>
911 Name output in <em>[PATCH]</em> format.
912 </p>
913 </dd>
914 <dt>
915 --start-number &lt;n&gt;
916 </dt>
917 <dd>
919 Start numbering the patches at &lt;n&gt; instead of 1.
920 </p>
921 </dd>
922 <dt>
923 --numbered-files
924 </dt>
925 <dd>
927 Output file names will be a simple number sequence
928 without the default first line of the commit appended.
929 </p>
930 </dd>
931 <dt>
933 </dt>
934 <dt>
935 --keep-subject
936 </dt>
937 <dd>
939 Do not strip/add <em>[PATCH]</em> from the first line of the
940 commit log message.
941 </p>
942 </dd>
943 <dt>
945 </dt>
946 <dt>
947 --signoff
948 </dt>
949 <dd>
951 Add <tt>Signed-off-by:</tt> line to the commit message, using
952 the committer identity of yourself.
953 </p>
954 </dd>
955 <dt>
956 --stdout
957 </dt>
958 <dd>
960 Print all commits to the standard output in mbox format,
961 instead of creating a file for each one.
962 </p>
963 </dd>
964 <dt>
965 --attach[=&lt;boundary&gt;]
966 </dt>
967 <dd>
969 Create multipart/mixed attachment, the first part of
970 which is the commit message and the patch itself in the
971 second part, with "Content-Disposition: attachment".
972 </p>
973 </dd>
974 <dt>
975 --no-attach
976 </dt>
977 <dd>
979 Disable the creation of an attachment, overriding the
980 configuration setting.
981 </p>
982 </dd>
983 <dt>
984 --inline[=&lt;boundary&gt;]
985 </dt>
986 <dd>
988 Create multipart/mixed attachment, the first part of
989 which is the commit message and the patch itself in the
990 second part, with "Content-Disposition: inline".
991 </p>
992 </dd>
993 <dt>
994 --thread[=&lt;style&gt;]
995 </dt>
996 <dd>
998 Add In-Reply-To and References headers to make the second and
999 subsequent mails appear as replies to the first. Also generates
1000 the Message-Id header to reference.
1001 </p>
1002 <div class="para"><p>The optional &lt;style&gt; argument can be either <tt>shallow</tt> or <tt>deep</tt>.
1003 <em>shallow</em> threading makes every mail a reply to the head of the
1004 series, where the head is chosen from the cover letter, the
1005 <tt>--in-reply-to</tt>, and the first patch mail, in this order. <em>deep</em>
1006 threading makes every mail a reply to the previous one. If not
1007 specified, defaults to the <em>format.thread</em> configuration, or <tt>shallow</tt>
1008 if that is not set.</p></div>
1009 </dd>
1010 <dt>
1011 --in-reply-to=Message-Id
1012 </dt>
1013 <dd>
1015 Make the first mail (or all the mails with --no-thread) appear as a
1016 reply to the given Message-Id, which avoids breaking threads to
1017 provide a new patch series.
1018 </p>
1019 </dd>
1020 <dt>
1021 --ignore-if-in-upstream
1022 </dt>
1023 <dd>
1025 Do not include a patch that matches a commit in
1026 &lt;until&gt;..&lt;since&gt;. This will examine all patches reachable
1027 from &lt;since&gt; but not from &lt;until&gt; and compare them with the
1028 patches being generated, and any patch that matches is
1029 ignored.
1030 </p>
1031 </dd>
1032 <dt>
1033 --subject-prefix=&lt;Subject-Prefix&gt;
1034 </dt>
1035 <dd>
1037 Instead of the standard <em>[PATCH]</em> prefix in the subject
1038 line, instead use <em>[&lt;Subject-Prefix&gt;]</em>. This
1039 allows for useful naming of a patch series, and can be
1040 combined with the --numbered option.
1041 </p>
1042 </dd>
1043 <dt>
1044 --cc=&lt;email&gt;
1045 </dt>
1046 <dd>
1048 Add a "Cc:" header to the email headers. This is in addition
1049 to any configured headers, and may be used multiple times.
1050 </p>
1051 </dd>
1052 <dt>
1053 --add-header=&lt;header&gt;
1054 </dt>
1055 <dd>
1057 Add an arbitrary header to the email headers. This is in addition
1058 to any configured headers, and may be used multiple times.
1059 For example, --add-header="Organization: git-foo"
1060 </p>
1061 </dd>
1062 <dt>
1063 --cover-letter
1064 </dt>
1065 <dd>
1067 In addition to the patches, generate a cover letter file
1068 containing the shortlog and the overall diffstat. You can
1069 fill in a description in the file before sending it out.
1070 </p>
1071 </dd>
1072 <dt>
1073 --suffix=.&lt;sfx&gt;
1074 </dt>
1075 <dd>
1077 Instead of using <tt>.patch</tt> as the suffix for generated
1078 filenames, use specified suffix. A common alternative is
1079 <tt>--suffix=.txt</tt>. Leaving this empty will remove the <tt>.patch</tt>
1080 suffix.
1081 </p>
1082 <div class="para"><p>Note that the leading character does not have to be a dot; for example,
1083 you can use <tt>--suffix=-patch</tt> to get <tt>0001-description-of-my-change-patch</tt>.</p></div>
1084 </dd>
1085 <dt>
1086 --no-binary
1087 </dt>
1088 <dd>
1090 Do not output contents of changes in binary files, instead
1091 display a notice that those files changed. Patches generated
1092 using this option cannot be applied properly, but they are
1093 still useful for code review.
1094 </p>
1095 </dd>
1096 <dt>
1097 --root
1098 </dt>
1099 <dd>
1101 Treat the revision argument as a &lt;revision range&gt;, even if it
1102 is just a single commit (that would normally be treated as a
1103 &lt;since&gt;). Note that root commits included in the specified
1104 range are always formatted as creation patches, independently
1105 of this flag.
1106 </p>
1107 </dd>
1108 </dl></div>
1109 </div>
1110 <h2 id="_configuration">CONFIGURATION</h2>
1111 <div class="sectionbody">
1112 <div class="para"><p>You can specify extra mail header lines to be added to each message,
1113 defaults for the subject prefix and file suffix, number patches when
1114 outputting more than one patch, add "Cc:" headers, configure attachments,
1115 and sign off patches with configuration variables.</p></div>
1116 <div class="listingblock">
1117 <div class="content">
1118 <pre><tt>[format]
1119 headers = "Organization: git-foo\n"
1120 subjectprefix = CHANGE
1121 suffix = .txt
1122 numbered = auto
1123 cc = &lt;email&gt;
1124 attach [ = mime-boundary-string ]
1125 signoff = true</tt></pre>
1126 </div></div>
1127 </div>
1128 <h2 id="_examples">EXAMPLES</h2>
1129 <div class="sectionbody">
1130 <div class="ilist"><ul>
1131 <li>
1133 Extract commits between revisions R1 and R2, and apply them on top of
1134 the current branch using <em>git-am</em> to cherry-pick them:
1135 </p>
1136 <div class="listingblock">
1137 <div class="content">
1138 <pre><tt>$ git format-patch -k --stdout R1..R2 | git am -3 -k</tt></pre>
1139 </div></div>
1140 </li>
1141 <li>
1143 Extract all commits which are in the current branch but not in the
1144 origin branch:
1145 </p>
1146 <div class="listingblock">
1147 <div class="content">
1148 <pre><tt>$ git format-patch origin</tt></pre>
1149 </div></div>
1150 <div class="para"><p>For each commit a separate file is created in the current directory.</p></div>
1151 </li>
1152 <li>
1154 Extract all commits that lead to <em>origin</em> since the inception of the
1155 project:
1156 </p>
1157 <div class="listingblock">
1158 <div class="content">
1159 <pre><tt>$ git format-patch --root origin</tt></pre>
1160 </div></div>
1161 </li>
1162 <li>
1164 The same as the previous one:
1165 </p>
1166 <div class="listingblock">
1167 <div class="content">
1168 <pre><tt>$ git format-patch -M -B origin</tt></pre>
1169 </div></div>
1170 <div class="para"><p>Additionally, it detects and handles renames and complete rewrites
1171 intelligently to produce a renaming patch. A renaming patch reduces
1172 the amount of text output, and generally makes it easier to review.
1173 Note that non-git "patch" programs won't understand renaming patches, so
1174 use it only when you know the recipient uses git to apply your patch.</p></div>
1175 </li>
1176 <li>
1178 Extract three topmost commits from the current branch and format them
1179 as e-mailable patches:
1180 </p>
1181 <div class="listingblock">
1182 <div class="content">
1183 <pre><tt>$ git format-patch -3</tt></pre>
1184 </div></div>
1185 </li>
1186 </ul></div>
1187 </div>
1188 <h2 id="_see_also">SEE ALSO</h2>
1189 <div class="sectionbody">
1190 <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>
1191 </div>
1192 <h2 id="_author">Author</h2>
1193 <div class="sectionbody">
1194 <div class="para"><p>Written by Junio C Hamano &lt;gitster@pobox.com&gt;</p></div>
1195 </div>
1196 <h2 id="_documentation">Documentation</h2>
1197 <div class="sectionbody">
1198 <div class="para"><p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
1199 </div>
1200 <h2 id="_git">GIT</h2>
1201 <div class="sectionbody">
1202 <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1203 </div>
1204 <div id="footer">
1205 <div id="footer-text">
1206 Last updated 2009-04-25 08:29:43 UTC
1207 </div>
1208 </div>
1209 </body>
1210 </html>