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">
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">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.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
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
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
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
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
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-am(
1) Manual Page
409 <div class=
"sectionbody">
411 Apply a series of patches from a mailbox
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=
<option
>] [-C
<n
>] [-p
<n
>] [--directory=
<dir
>]
422 [--reject] [-q | --quiet] [--scissors | --no-scissors]
423 [(
<mbox
> |
<Maildir
>)
…]
424 <em>git am
</em> (--continue | --skip | --abort)
</div>
425 <div class=
"verseblock-attribution">
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>
434 <h2 id=
"_options">OPTIONS
</h2>
435 <div class=
"sectionbody">
436 <div class=
"dlist"><dl>
438 (
<mbox
>|
<Maildir
>)
…
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.
455 Add a
<tt>Signed-off-by:
</tt> line to the commit message, using
456 the committer identity of yourself.
467 Pass
<tt>-k
</tt> flag to
<em>git mailinfo
</em> (see
<a href=
"git-mailinfo.html">git-mailinfo(
1)
</a>).
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>.
492 Remove everything in body before a scissors line (see
493 <a href=
"git-mailinfo.html">git-mailinfo(
1)
</a>).
501 Ignore scissors lines (see
<a href=
"git-mailinfo.html">git-mailinfo(
1)
</a>).
512 Be quiet. Only print error messages.
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
’s
527 preferred encoding if it is not UTF-
8).
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>
537 Pass
<tt>-n
</tt> flag to
<em>git mailinfo
</em> (see
538 <a href=
"git-mailinfo.html">git-mailinfo(
1)
</a>).
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
559 --ignore-space-change
565 --whitespace=
<option
>
574 --directory=
<dir
>
581 These flags are passed to the
<em>git apply
</em> (see
<a href=
"git-apply.html">git-apply(
1)
</a>)
598 --committer-date-is-author-date
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.
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.
626 Skip the current patch. This is only meaningful when
627 restarting an aborted patch.
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
650 --resolvemsg=
<msg
>
654 When a patch failure occurs,
<msg
> 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>.
666 Restore the original branch and abort the patching operation.
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 <anything>]".
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>
690 three-dashes and end-of-line, or
695 a line that begins with
"diff -", or
700 a line that begins with
"Index: "
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">
712 skip the current patch by re-running the command with the
<em>--skip
</em>
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.
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
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>
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>
738 <h2 id=
"_author">Author
</h2>
739 <div class=
"sectionbody">
740 <div class=
"paragraph"><p>Written by Junio C Hamano
<<a href=
"mailto:gitster@pobox.com">gitster@pobox.com
</a>></p></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
<<a href=
"mailto:git@vger.kernel.org">git@vger.kernel.org
</a>>.
</p></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>
751 <div id=
"footer-text">
752 Last updated
2010-
11-
06 00:
41:
57 UTC