1GIT-AM(1) Git Manual GIT-AM(1)
2
3
4
6 git-am - Apply a series of patches from a mailbox
7
9 git am [--signoff] [--keep] [--keep-cr | --no-keep-cr] [--utf8 | --no-utf8]
10 [--3way] [--interactive] [--committer-date-is-author-date]
11 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
12 [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
13 [--reject] [-q | --quiet] [--scissors | --no-scissors]
14 [(<mbox> | <Maildir>)...]
15 git am (--continue | --skip | --abort)
16
17
19 Splits mail messages in a mailbox into commit log message, authorship
20 information and patches, and applies them to the current branch.
21
23 (<mbox>|<Maildir>)...
24 The list of mailbox files to read patches from. If you do not
25 supply this argument, the command reads from the standard input. If
26 you supply directories, they will be treated as Maildirs.
27
28 -s, --signoff
29 Add a Signed-off-by: line to the commit message, using the
30 committer identity of yourself.
31
32 -k, --keep
33 Pass -k flag to git mailinfo (see git-mailinfo(1)).
34
35 --keep-cr, --no-keep-cr
36 With --keep-cr, call git mailsplit (see git-mailsplit(1)) with the
37 same option, to prevent it from stripping CR at the end of lines.
38 am.keepcr configuration variable can be used to specify the default
39 behaviour. --no-keep-cr is useful to override am.keepcr.
40
41 -c, --scissors
42 Remove everything in body before a scissors line (see git-
43 mailinfo(1)).
44
45 --no-scissors
46 Ignore scissors lines (see git-mailinfo(1)).
47
48 -q, --quiet
49 Be quiet. Only print error messages.
50
51 -u, --utf8
52 Pass -u flag to git mailinfo (see git-mailinfo(1)). The proposed
53 commit log message taken from the e-mail is re-coded into UTF-8
54 encoding (configuration variable i18n.commitencoding can be used to
55 specify project’s preferred encoding if it is not UTF-8).
56
57 This was optional in prior versions of git, but now it is the
58 default. You can use --no-utf8 to override this.
59
60 --no-utf8
61 Pass -n flag to git mailinfo (see git-mailinfo(1)).
62
63 -3, --3way
64 When the patch does not apply cleanly, fall back on 3-way merge if
65 the patch records the identity of blobs it is supposed to apply to
66 and we have those blobs available locally.
67
68 --ignore-date, --ignore-space-change, --ignore-whitespace,
69 --whitespace=<option>, -C<n>, -p<n>, --directory=<dir>, --reject
70 These flags are passed to the git apply (see git-apply(1)) program
71 that applies the patch.
72
73 -i, --interactive
74 Run interactively.
75
76 --committer-date-is-author-date
77 By default the command records the date from the e-mail message as
78 the commit author date, and uses the time of commit creation as the
79 committer date. This allows the user to lie about the committer
80 date by using the same value as the author date.
81
82 --ignore-date
83 By default the command records the date from the e-mail message as
84 the commit author date, and uses the time of commit creation as the
85 committer date. This allows the user to lie about the author date
86 by using the same value as the committer date.
87
88 --skip
89 Skip the current patch. This is only meaningful when restarting an
90 aborted patch.
91
92 --continue, -r, --resolved
93 After a patch failure (e.g. attempting to apply conflicting patch),
94 the user has applied it by hand and the index file stores the
95 result of the application. Make a commit using the authorship and
96 commit log extracted from the e-mail message and the current index
97 file, and continue.
98
99 --resolvemsg=<msg>
100 When a patch failure occurs, <msg> will be printed to the screen
101 before exiting. This overrides the standard message informing you
102 to use --resolved or --skip to handle the failure. This is solely
103 for internal use between git rebase and git am.
104
105 --abort
106 Restore the original branch and abort the patching operation.
107
109 The commit author name is taken from the "From: " line of the message,
110 and commit author date is taken from the "Date: " line of the message.
111 The "Subject: " line is used as the title of the commit, after
112 stripping common prefix "[PATCH <anything>]". The "Subject: " line is
113 supposed to concisely describe what the commit is about in one line of
114 text.
115
116 "From: " and "Subject: " lines starting the body override the
117 respective commit author name and title values taken from the headers.
118
119 The commit message is formed by the title taken from the "Subject: ", a
120 blank line and the body of the message up to where the patch begins.
121 Excess whitespace at the end of each line is automatically stripped.
122
123 The patch is expected to be inline, directly following the message. Any
124 line that is of the form:
125
126 · three-dashes and end-of-line, or
127
128 · a line that begins with "diff -", or
129
130 · a line that begins with "Index: "
131
132 is taken as the beginning of a patch, and the commit log message is
133 terminated before the first occurrence of such a line.
134
135 When initially invoking git am, you give it the names of the mailboxes
136 to process. Upon seeing the first patch that does not apply, it aborts
137 in the middle. You can recover from this in one of two ways:
138
139 1. skip the current patch by re-running the command with the --skip
140 option.
141
142 2. hand resolve the conflict in the working directory, and update the
143 index file to bring it into a state that the patch should have
144 produced. Then run the command with the --resolved option.
145
146 The command refuses to process new mailboxes until the current
147 operation is finished, so if you decide to start over from scratch, run
148 git am --abort before running the command with mailbox names.
149
150 Before any patches are applied, ORIG_HEAD is set to the tip of the
151 current branch. This is useful if you have problems with multiple
152 commits, like running git am on the wrong branch or an error in the
153 commits that is more easily fixed by changing the mailbox (e.g. errors
154 in the "From:" lines).
155
157 git-apply(1).
158
160 Written by Junio C Hamano <gitster@pobox.com[1]>
161
163 Documentation by Petr Baudis, Junio C Hamano and the git-list
164 <git@vger.kernel.org[2]>.
165
167 Part of the git(1) suite
168
170 1. gitster@pobox.com
171 mailto:gitster@pobox.com
172
173 2. git@vger.kernel.org
174 mailto:git@vger.kernel.org
175
176
177
178Git 1.7.4.4 04/11/2011 GIT-AM(1)