1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <sect2 lang="en" id="git-am(1)">
\r
5 <title>git-am(1)</title>
\r
7 <primary>git-am(1)</primary>
\r
9 <simplesect id="git-am(1)__name">
\r
11 <simpara>git-am - Apply a series of patches from a mailbox</simpara>
\r
13 <simplesect id="git-am(1)__synopsis">
\r
14 <title>SYNOPSIS</title>
\r
16 <literallayout><emphasis>git am</emphasis> [--signoff] [--keep] [--keep-cr | --no-keep-cr] [--utf8 | --no-utf8]
\r
17 [--3way] [--interactive] [--committer-date-is-author-date]
\r
18 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
\r
19 [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
\r
20 [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
\r
21 [--scissors | --no-scissors]
\r
22 [(<mbox> | <Maildir>)…]
\r
23 <emphasis>git am</emphasis> (--continue | --skip | --abort)</literallayout>
\r
26 <simplesect id="git-am(1)__description">
\r
27 <title>DESCRIPTION</title>
\r
28 <simpara>Splits mail messages in a mailbox into commit log message,
\r
29 authorship information and patches, and applies them to the
\r
30 current branch.</simpara>
\r
32 <simplesect id="git-am(1)__options">
\r
33 <title>OPTIONS</title>
\r
37 (<mbox>|<Maildir>)…
\r
41 The list of mailbox files to read patches from. If you do not
\r
42 supply this argument, the command reads from the standard input.
\r
43 If you supply directories, they will be treated as Maildirs.
\r
56 Add a <emphasis>Signed-off-by:</emphasis> line to the commit message, using
\r
57 the committer identity of yourself.
\r
70 Pass <emphasis>-k</emphasis> flag to <emphasis>git mailinfo</emphasis> (see <xref linkend="git-mailinfo(1)" />).
\r
80 Pass <emphasis>-b</emphasis> flag to <emphasis>git mailinfo</emphasis> (see <xref linkend="git-mailinfo(1)" />).
\r
93 With <emphasis>--keep-cr</emphasis>, call <emphasis>git mailsplit</emphasis> (see <xref linkend="git-mailsplit(1)" />)
\r
94 with the same option, to prevent it from stripping CR at the end of
\r
95 lines. <emphasis>am.keepcr</emphasis> configuration variable can be used to specify the
\r
96 default behaviour. <emphasis>--no-keep-cr</emphasis> is useful to override <emphasis>am.keepcr</emphasis>.
\r
109 Remove everything in body before a scissors line (see
\r
110 <xref linkend="git-mailinfo(1)" />).
\r
120 Ignore scissors lines (see <xref linkend="git-mailinfo(1)" />).
\r
133 Be quiet. Only print error messages.
\r
146 Pass <emphasis>-u</emphasis> flag to <emphasis>git mailinfo</emphasis> (see <xref linkend="git-mailinfo(1)" />).
\r
147 The proposed commit log message taken from the e-mail
\r
148 is re-coded into UTF-8 encoding (configuration variable
\r
149 <emphasis>i18n.commitencoding</emphasis> can be used to specify project's
\r
150 preferred encoding if it is not UTF-8).
\r
152 <simpara>This was optional in prior versions of git, but now it is the
\r
153 default. You can use <emphasis>--no-utf8</emphasis> to override this.</simpara>
\r
162 Pass <emphasis>-n</emphasis> flag to <emphasis>git mailinfo</emphasis> (see
\r
163 <xref linkend="git-mailinfo(1)" />).
\r
176 When the patch does not apply cleanly, fall back on
\r
177 3-way merge if the patch records the identity of blobs
\r
178 it is supposed to apply to and we have those blobs
\r
188 --ignore-space-change
\r
191 --ignore-whitespace
\r
194 --whitespace=<option>
\r
203 --directory=<dir>
\r
206 --exclude=<path>
\r
209 --include=<path>
\r
216 These flags are passed to the <emphasis>git apply</emphasis> (see <xref linkend="git-apply(1)" />)
\r
217 program that applies
\r
237 --committer-date-is-author-date
\r
241 By default the command records the date from the e-mail
\r
242 message as the commit author date, and uses the time of
\r
243 commit creation as the committer date. This allows the
\r
244 user to lie about the committer date by using the same
\r
245 value as the author date.
\r
255 By default the command records the date from the e-mail
\r
256 message as the commit author date, and uses the time of
\r
257 commit creation as the committer date. This allows the
\r
258 user to lie about the author date by using the same
\r
259 value as the committer date.
\r
269 Skip the current patch. This is only meaningful when
\r
270 restarting an aborted patch.
\r
286 After a patch failure (e.g. attempting to apply
\r
287 conflicting patch), the user has applied it by hand and
\r
288 the index file stores the result of the application.
\r
289 Make a commit using the authorship and commit log
\r
290 extracted from the e-mail message and the current index
\r
291 file, and continue.
\r
297 --resolvemsg=<msg>
\r
301 When a patch failure occurs, <msg> will be printed
\r
302 to the screen before exiting. This overrides the
\r
303 standard message informing you to use <emphasis>--resolved</emphasis>
\r
304 or <emphasis>--skip</emphasis> to handle the failure. This is solely
\r
305 for internal use between <emphasis>git rebase</emphasis> and <emphasis>git am</emphasis>.
\r
315 Restore the original branch and abort the patching operation.
\r
321 <simplesect id="git-am(1)__discussion">
\r
322 <title>DISCUSSION</title>
\r
323 <simpara>The commit author name is taken from the "From: " line of the
\r
324 message, and commit author date is taken from the "Date: " line
\r
325 of the message. The "Subject: " line is used as the title of
\r
326 the commit, after stripping common prefix "[PATCH <anything>]".
\r
327 The "Subject: " line is supposed to concisely describe what the
\r
328 commit is about in one line of text.</simpara>
\r
329 <simpara>"From: " and "Subject: " lines starting the body override the respective
\r
330 commit author name and title values taken from the headers.</simpara>
\r
331 <simpara>The commit message is formed by the title taken from the
\r
332 "Subject: ", a blank line and the body of the message up to
\r
333 where the patch begins. Excess whitespace at the end of each
\r
334 line is automatically stripped.</simpara>
\r
335 <simpara>The patch is expected to be inline, directly following the
\r
336 message. Any line that is of the form:</simpara>
\r
340 three-dashes and end-of-line, or
\r
345 a line that begins with "diff -", or
\r
350 a line that begins with "Index: "
\r
354 <simpara>is taken as the beginning of a patch, and the commit log message
\r
355 is terminated before the first occurrence of such a line.</simpara>
\r
356 <simpara>When initially invoking <emphasis>git am</emphasis>, you give it the names of the mailboxes
\r
357 to process. Upon seeing the first patch that does not apply, it
\r
358 aborts in the middle. You can recover from this in one of two ways:</simpara>
\r
359 <orderedlist numeration="arabic">
\r
362 skip the current patch by re-running the command with the <emphasis>--skip</emphasis>
\r
368 hand resolve the conflict in the working directory, and update
\r
369 the index file to bring it into a state that the patch should
\r
370 have produced. Then run the command with the <emphasis>--resolved</emphasis> option.
\r
374 <simpara>The command refuses to process new mailboxes until the current
\r
375 operation is finished, so if you decide to start over from scratch,
\r
376 run <emphasis>git am --abort</emphasis> before running the command with mailbox
\r
378 <simpara>Before any patches are applied, ORIG_HEAD is set to the tip of the
\r
379 current branch. This is useful if you have problems with multiple
\r
380 commits, like running <emphasis>git am</emphasis> on the wrong branch or an error in the
\r
381 commits that is more easily fixed by changing the mailbox (e.g.
\r
382 errors in the "From:" lines).</simpara>
\r
384 <simplesect id="git-am(1)__see_also">
\r
385 <title>SEE ALSO</title>
\r
386 <simpara><xref linkend="git-apply(1)" />.</simpara>
\r
388 <simplesect id="git-am(1)__git">
\r
390 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r