Autogenerated HTML docs for v1.6.6.1-383-g5a9f
[git/jnareb-git.git] / git-am.html
blob533a4981ec5bd0bfae30c948299f845c4c367100
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-am(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-am(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-am -
317 Apply a series of patches from a mailbox
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="verseblock">
324 <div class="content"><em>git am</em> [--signoff] [--keep] [--utf8 | --no-utf8]
325 [--3way] [--interactive] [--committer-date-is-author-date]
326 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
327 [--whitespace=&lt;option&gt;] [-C&lt;n&gt;] [-p&lt;n&gt;] [--directory=&lt;dir&gt;]
328 [--reject] [-q | --quiet] [--scissors | --no-scissors]
329 [&lt;mbox&gt; | &lt;Maildir&gt;&#8230;]
330 <em>git am</em> (--skip | --resolved | --abort)</div></div>
331 </div>
332 <h2 id="_description">DESCRIPTION</h2>
333 <div class="sectionbody">
334 <div class="para"><p>Splits mail messages in a mailbox into commit log message,
335 authorship information and patches, and applies them to the
336 current branch.</p></div>
337 </div>
338 <h2 id="_options">OPTIONS</h2>
339 <div class="sectionbody">
340 <div class="vlist"><dl>
341 <dt>
342 &lt;mbox&gt;|&lt;Maildir&gt;&#8230;
343 </dt>
344 <dd>
346 The list of mailbox files to read patches from. If you do not
347 supply this argument, the command reads from the standard input.
348 If you supply directories, they will be treated as Maildirs.
349 </p>
350 </dd>
351 <dt>
353 </dt>
354 <dt>
355 --signoff
356 </dt>
357 <dd>
359 Add a <tt>Signed-off-by:</tt> line to the commit message, using
360 the committer identity of yourself.
361 </p>
362 </dd>
363 <dt>
365 </dt>
366 <dt>
367 --keep
368 </dt>
369 <dd>
371 Pass <tt>-k</tt> flag to <em>git mailinfo</em> (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
372 </p>
373 </dd>
374 <dt>
376 </dt>
377 <dt>
378 --scissors
379 </dt>
380 <dd>
382 Remove everything in body before a scissors line (see
383 <a href="git-mailinfo.html">git-mailinfo(1)</a>).
384 </p>
385 </dd>
386 <dt>
387 ---no-scissors
388 </dt>
389 <dd>
391 Ignore scissors lines (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
392 </p>
393 </dd>
394 <dt>
396 </dt>
397 <dt>
398 --quiet
399 </dt>
400 <dd>
402 Be quiet. Only print error messages.
403 </p>
404 </dd>
405 <dt>
407 </dt>
408 <dt>
409 --utf8
410 </dt>
411 <dd>
413 Pass <tt>-u</tt> flag to <em>git mailinfo</em> (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
414 The proposed commit log message taken from the e-mail
415 is re-coded into UTF-8 encoding (configuration variable
416 <tt>i18n.commitencoding</tt> can be used to specify project's
417 preferred encoding if it is not UTF-8).
418 </p>
419 <div class="para"><p>This was optional in prior versions of git, but now it is the
420 default. You can use <tt>--no-utf8</tt> to override this.</p></div>
421 </dd>
422 <dt>
423 --no-utf8
424 </dt>
425 <dd>
427 Pass <tt>-n</tt> flag to <em>git mailinfo</em> (see
428 <a href="git-mailinfo.html">git-mailinfo(1)</a>).
429 </p>
430 </dd>
431 <dt>
433 </dt>
434 <dt>
435 --3way
436 </dt>
437 <dd>
439 When the patch does not apply cleanly, fall back on
440 3-way merge if the patch records the identity of blobs
441 it is supposed to apply to and we have those blobs
442 available locally.
443 </p>
444 </dd>
445 <dt>
446 --ignore-date
447 </dt>
448 <dt>
449 --ignore-space-change
450 </dt>
451 <dt>
452 --ignore-whitespace
453 </dt>
454 <dt>
455 --whitespace=&lt;option&gt;
456 </dt>
457 <dt>
458 -C&lt;n&gt;
459 </dt>
460 <dt>
461 -p&lt;n&gt;
462 </dt>
463 <dt>
464 --directory=&lt;dir&gt;
465 </dt>
466 <dt>
467 --reject
468 </dt>
469 <dd>
471 These flags are passed to the <em>git apply</em> (see <a href="git-apply.html">git-apply(1)</a>)
472 program that applies
473 the patch.
474 </p>
475 </dd>
476 <dt>
478 </dt>
479 <dt>
480 --interactive
481 </dt>
482 <dd>
484 Run interactively.
485 </p>
486 </dd>
487 <dt>
488 --committer-date-is-author-date
489 </dt>
490 <dd>
492 By default the command records the date from the e-mail
493 message as the commit author date, and uses the time of
494 commit creation as the committer date. This allows the
495 user to lie about the committer date by using the same
496 value as the author date.
497 </p>
498 </dd>
499 <dt>
500 --ignore-date
501 </dt>
502 <dd>
504 By default the command records the date from the e-mail
505 message as the commit author date, and uses the time of
506 commit creation as the committer date. This allows the
507 user to lie about the author date by using the same
508 value as the committer date.
509 </p>
510 </dd>
511 <dt>
512 --skip
513 </dt>
514 <dd>
516 Skip the current patch. This is only meaningful when
517 restarting an aborted patch.
518 </p>
519 </dd>
520 <dt>
522 </dt>
523 <dt>
524 --resolved
525 </dt>
526 <dd>
528 After a patch failure (e.g. attempting to apply
529 conflicting patch), the user has applied it by hand and
530 the index file stores the result of the application.
531 Make a commit using the authorship and commit log
532 extracted from the e-mail message and the current index
533 file, and continue.
534 </p>
535 </dd>
536 <dt>
537 --resolvemsg=&lt;msg&gt;
538 </dt>
539 <dd>
541 When a patch failure occurs, &lt;msg&gt; will be printed
542 to the screen before exiting. This overrides the
543 standard message informing you to use <tt>--resolved</tt>
544 or <tt>--skip</tt> to handle the failure. This is solely
545 for internal use between <em>git rebase</em> and <em>git am</em>.
546 </p>
547 </dd>
548 <dt>
549 --abort
550 </dt>
551 <dd>
553 Restore the original branch and abort the patching operation.
554 </p>
555 </dd>
556 </dl></div>
557 </div>
558 <h2 id="_discussion">DISCUSSION</h2>
559 <div class="sectionbody">
560 <div class="para"><p>The commit author name is taken from the "From: " line of the
561 message, and commit author date is taken from the "Date: " line
562 of the message. The "Subject: " line is used as the title of
563 the commit, after stripping common prefix "[PATCH &lt;anything&gt;]".
564 The "Subject: " line is supposed to concisely describe what the
565 commit is about in one line of text.</p></div>
566 <div class="para"><p>"From: " and "Subject: " lines starting the body override the respective
567 commit author name and title values taken from the headers.</p></div>
568 <div class="para"><p>The commit message is formed by the title taken from the
569 "Subject: ", a blank line and the body of the message up to
570 where the patch begins. Excess whitespace at the end of each
571 line is automatically stripped.</p></div>
572 <div class="para"><p>The patch is expected to be inline, directly following the
573 message. Any line that is of the form:</p></div>
574 <div class="ilist"><ul>
575 <li>
577 three-dashes and end-of-line, or
578 </p>
579 </li>
580 <li>
582 a line that begins with "diff -", or
583 </p>
584 </li>
585 <li>
587 a line that begins with "Index: "
588 </p>
589 </li>
590 </ul></div>
591 <div class="para"><p>is taken as the beginning of a patch, and the commit log message
592 is terminated before the first occurrence of such a line.</p></div>
593 <div class="para"><p>When initially invoking <tt>git am</tt>, you give it the names of the mailboxes
594 to process. Upon seeing the first patch that does not apply, it
595 aborts in the middle. You can recover from this in one of two ways:</p></div>
596 <div class="olist"><ol>
597 <li>
599 skip the current patch by re-running the command with the <em>--skip</em>
600 option.
601 </p>
602 </li>
603 <li>
605 hand resolve the conflict in the working directory, and update
606 the index file to bring it into a state that the patch should
607 have produced. Then run the command with the <em>--resolved</em> option.
608 </p>
609 </li>
610 </ol></div>
611 <div class="para"><p>The command refuses to process new mailboxes while the <tt>.git/rebase-apply</tt>
612 directory exists, so if you decide to start over from scratch,
613 run <tt>rm -f -r .git/rebase-apply</tt> before running the command with mailbox
614 names.</p></div>
615 <div class="para"><p>Before any patches are applied, ORIG_HEAD is set to the tip of the
616 current branch. This is useful if you have problems with multiple
617 commits, like running <em>git am</em> on the wrong branch or an error in the
618 commits that is more easily fixed by changing the mailbox (e.g.
619 errors in the "From:" lines).</p></div>
620 </div>
621 <h2 id="_see_also">SEE ALSO</h2>
622 <div class="sectionbody">
623 <div class="para"><p><a href="git-apply.html">git-apply(1)</a>.</p></div>
624 </div>
625 <h2 id="_author">Author</h2>
626 <div class="sectionbody">
627 <div class="para"><p>Written by Junio C Hamano &lt;gitster@pobox.com&gt;</p></div>
628 </div>
629 <h2 id="_documentation">Documentation</h2>
630 <div class="sectionbody">
631 <div class="para"><p>Documentation by Petr Baudis, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
632 </div>
633 <h2 id="_git">GIT</h2>
634 <div class="sectionbody">
635 <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
636 </div>
637 <div id="footer">
638 <div id="footer-text">
639 Last updated 2010-01-21 17:44:21 UTC
640 </div>
641 </div>
642 </body>
643 </html>