Autogenerated HTML docs for v1.7.4.1-176-g501cc
[git/jnareb-git.git] / git-am.html
blob1095e93050d139b362405acfcd04b4077ab92d8c
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-am(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-am(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-am -
411 Apply a series of patches from a mailbox
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 am</em> [--signoff] [--keep] [--keep-cr | --no-keep-cr] [--utf8 | --no-utf8]
419 [--3way] [--interactive] [--committer-date-is-author-date]
420 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
421 [--whitespace=&lt;option&gt;] [-C&lt;n&gt;] [-p&lt;n&gt;] [--directory=&lt;dir&gt;]
422 [--reject] [-q | --quiet] [--scissors | --no-scissors]
423 [(&lt;mbox&gt; | &lt;Maildir&gt;)&#8230;]
424 <em>git am</em> (--continue | --skip | --abort)</div>
425 <div class="verseblock-attribution">
426 </div></div>
427 </div>
428 <h2 id="_description">DESCRIPTION</h2>
429 <div class="sectionbody">
430 <div class="paragraph"><p>Splits mail messages in a mailbox into commit log message,
431 authorship information and patches, and applies them to the
432 current branch.</p></div>
433 </div>
434 <h2 id="_options">OPTIONS</h2>
435 <div class="sectionbody">
436 <div class="dlist"><dl>
437 <dt class="hdlist1">
438 (&lt;mbox&gt;|&lt;Maildir&gt;)&#8230;
439 </dt>
440 <dd>
442 The list of mailbox files to read patches from. If you do not
443 supply this argument, the command reads from the standard input.
444 If you supply directories, they will be treated as Maildirs.
445 </p>
446 </dd>
447 <dt class="hdlist1">
449 </dt>
450 <dt class="hdlist1">
451 --signoff
452 </dt>
453 <dd>
455 Add a <tt>Signed-off-by:</tt> line to the commit message, using
456 the committer identity of yourself.
457 </p>
458 </dd>
459 <dt class="hdlist1">
461 </dt>
462 <dt class="hdlist1">
463 --keep
464 </dt>
465 <dd>
467 Pass <tt>-k</tt> flag to <em>git mailinfo</em> (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
468 </p>
469 </dd>
470 <dt class="hdlist1">
471 --keep-cr
472 </dt>
473 <dt class="hdlist1">
474 --no-keep-cr
475 </dt>
476 <dd>
478 With <tt>--keep-cr</tt>, call <em>git mailsplit</em> (see <a href="git-mailsplit.html">git-mailsplit(1)</a>)
479 with the same option, to prevent it from stripping CR at the end of
480 lines. <tt>am.keepcr</tt> configuration variable can be used to specify the
481 default behaviour. <tt>--no-keep-cr</tt> is useful to override <tt>am.keepcr</tt>.
482 </p>
483 </dd>
484 <dt class="hdlist1">
486 </dt>
487 <dt class="hdlist1">
488 --scissors
489 </dt>
490 <dd>
492 Remove everything in body before a scissors line (see
493 <a href="git-mailinfo.html">git-mailinfo(1)</a>).
494 </p>
495 </dd>
496 <dt class="hdlist1">
497 --no-scissors
498 </dt>
499 <dd>
501 Ignore scissors lines (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
502 </p>
503 </dd>
504 <dt class="hdlist1">
506 </dt>
507 <dt class="hdlist1">
508 --quiet
509 </dt>
510 <dd>
512 Be quiet. Only print error messages.
513 </p>
514 </dd>
515 <dt class="hdlist1">
517 </dt>
518 <dt class="hdlist1">
519 --utf8
520 </dt>
521 <dd>
523 Pass <tt>-u</tt> flag to <em>git mailinfo</em> (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
524 The proposed commit log message taken from the e-mail
525 is re-coded into UTF-8 encoding (configuration variable
526 <tt>i18n.commitencoding</tt> can be used to specify project&#8217;s
527 preferred encoding if it is not UTF-8).
528 </p>
529 <div class="paragraph"><p>This was optional in prior versions of git, but now it is the
530 default. You can use <tt>--no-utf8</tt> to override this.</p></div>
531 </dd>
532 <dt class="hdlist1">
533 --no-utf8
534 </dt>
535 <dd>
537 Pass <tt>-n</tt> flag to <em>git mailinfo</em> (see
538 <a href="git-mailinfo.html">git-mailinfo(1)</a>).
539 </p>
540 </dd>
541 <dt class="hdlist1">
543 </dt>
544 <dt class="hdlist1">
545 --3way
546 </dt>
547 <dd>
549 When the patch does not apply cleanly, fall back on
550 3-way merge if the patch records the identity of blobs
551 it is supposed to apply to and we have those blobs
552 available locally.
553 </p>
554 </dd>
555 <dt class="hdlist1">
556 --ignore-date
557 </dt>
558 <dt class="hdlist1">
559 --ignore-space-change
560 </dt>
561 <dt class="hdlist1">
562 --ignore-whitespace
563 </dt>
564 <dt class="hdlist1">
565 --whitespace=&lt;option&gt;
566 </dt>
567 <dt class="hdlist1">
568 -C&lt;n&gt;
569 </dt>
570 <dt class="hdlist1">
571 -p&lt;n&gt;
572 </dt>
573 <dt class="hdlist1">
574 --directory=&lt;dir&gt;
575 </dt>
576 <dt class="hdlist1">
577 --reject
578 </dt>
579 <dd>
581 These flags are passed to the <em>git apply</em> (see <a href="git-apply.html">git-apply(1)</a>)
582 program that applies
583 the patch.
584 </p>
585 </dd>
586 <dt class="hdlist1">
588 </dt>
589 <dt class="hdlist1">
590 --interactive
591 </dt>
592 <dd>
594 Run interactively.
595 </p>
596 </dd>
597 <dt class="hdlist1">
598 --committer-date-is-author-date
599 </dt>
600 <dd>
602 By default the command records the date from the e-mail
603 message as the commit author date, and uses the time of
604 commit creation as the committer date. This allows the
605 user to lie about the committer date by using the same
606 value as the author date.
607 </p>
608 </dd>
609 <dt class="hdlist1">
610 --ignore-date
611 </dt>
612 <dd>
614 By default the command records the date from the e-mail
615 message as the commit author date, and uses the time of
616 commit creation as the committer date. This allows the
617 user to lie about the author date by using the same
618 value as the committer date.
619 </p>
620 </dd>
621 <dt class="hdlist1">
622 --skip
623 </dt>
624 <dd>
626 Skip the current patch. This is only meaningful when
627 restarting an aborted patch.
628 </p>
629 </dd>
630 <dt class="hdlist1">
631 --continue
632 </dt>
633 <dt class="hdlist1">
635 </dt>
636 <dt class="hdlist1">
637 --resolved
638 </dt>
639 <dd>
641 After a patch failure (e.g. attempting to apply
642 conflicting patch), the user has applied it by hand and
643 the index file stores the result of the application.
644 Make a commit using the authorship and commit log
645 extracted from the e-mail message and the current index
646 file, and continue.
647 </p>
648 </dd>
649 <dt class="hdlist1">
650 --resolvemsg=&lt;msg&gt;
651 </dt>
652 <dd>
654 When a patch failure occurs, &lt;msg&gt; will be printed
655 to the screen before exiting. This overrides the
656 standard message informing you to use <tt>--resolved</tt>
657 or <tt>--skip</tt> to handle the failure. This is solely
658 for internal use between <em>git rebase</em> and <em>git am</em>.
659 </p>
660 </dd>
661 <dt class="hdlist1">
662 --abort
663 </dt>
664 <dd>
666 Restore the original branch and abort the patching operation.
667 </p>
668 </dd>
669 </dl></div>
670 </div>
671 <h2 id="_discussion">DISCUSSION</h2>
672 <div class="sectionbody">
673 <div class="paragraph"><p>The commit author name is taken from the "From: " line of the
674 message, and commit author date is taken from the "Date: " line
675 of the message. The "Subject: " line is used as the title of
676 the commit, after stripping common prefix "[PATCH &lt;anything&gt;]".
677 The "Subject: " line is supposed to concisely describe what the
678 commit is about in one line of text.</p></div>
679 <div class="paragraph"><p>"From: " and "Subject: " lines starting the body override the respective
680 commit author name and title values taken from the headers.</p></div>
681 <div class="paragraph"><p>The commit message is formed by the title taken from the
682 "Subject: ", a blank line and the body of the message up to
683 where the patch begins. Excess whitespace at the end of each
684 line is automatically stripped.</p></div>
685 <div class="paragraph"><p>The patch is expected to be inline, directly following the
686 message. Any line that is of the form:</p></div>
687 <div class="ulist"><ul>
688 <li>
690 three-dashes and end-of-line, or
691 </p>
692 </li>
693 <li>
695 a line that begins with "diff -", or
696 </p>
697 </li>
698 <li>
700 a line that begins with "Index: "
701 </p>
702 </li>
703 </ul></div>
704 <div class="paragraph"><p>is taken as the beginning of a patch, and the commit log message
705 is terminated before the first occurrence of such a line.</p></div>
706 <div class="paragraph"><p>When initially invoking <tt>git am</tt>, you give it the names of the mailboxes
707 to process. Upon seeing the first patch that does not apply, it
708 aborts in the middle. You can recover from this in one of two ways:</p></div>
709 <div class="olist arabic"><ol class="arabic">
710 <li>
712 skip the current patch by re-running the command with the <em>--skip</em>
713 option.
714 </p>
715 </li>
716 <li>
718 hand resolve the conflict in the working directory, and update
719 the index file to bring it into a state that the patch should
720 have produced. Then run the command with the <em>--resolved</em> option.
721 </p>
722 </li>
723 </ol></div>
724 <div class="paragraph"><p>The command refuses to process new mailboxes while the <tt>.git/rebase-apply</tt>
725 directory exists, so if you decide to start over from scratch,
726 run <tt>rm -f -r .git/rebase-apply</tt> before running the command with mailbox
727 names.</p></div>
728 <div class="paragraph"><p>Before any patches are applied, ORIG_HEAD is set to the tip of the
729 current branch. This is useful if you have problems with multiple
730 commits, like running <em>git am</em> on the wrong branch or an error in the
731 commits that is more easily fixed by changing the mailbox (e.g.
732 errors in the "From:" lines).</p></div>
733 </div>
734 <h2 id="_see_also">SEE ALSO</h2>
735 <div class="sectionbody">
736 <div class="paragraph"><p><a href="git-apply.html">git-apply(1)</a>.</p></div>
737 </div>
738 <h2 id="_author">Author</h2>
739 <div class="sectionbody">
740 <div class="paragraph"><p>Written by Junio C Hamano &lt;<a href="mailto:gitster@pobox.com">gitster@pobox.com</a>&gt;</p></div>
741 </div>
742 <h2 id="_documentation">Documentation</h2>
743 <div class="sectionbody">
744 <div class="paragraph"><p>Documentation by Petr Baudis, Junio C Hamano and the git-list &lt;<a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>&gt;.</p></div>
745 </div>
746 <h2 id="_git">GIT</h2>
747 <div class="sectionbody">
748 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
749 </div>
750 <div id="footer">
751 <div id="footer-text">
752 Last updated 2010-11-06 00:41:57 UTC
753 </div>
754 </div>
755 </body>
756 </html>