operation to their
pre-am state.
--quit::
Abort the patching operation but keep HEAD and the index
untouched.
--retry::
Try to apply the last conflicting patch again. This is generally
only useful for passing extra options to the retry attempt
(e.g., `--3way`), since otherwise you'll just see the same
failure again.
--show-current-patch[=(diff|raw)]::
Show the message at which `git am` has stopped due to
conflicts. If `raw` is specified, show the raw contents of
the e-mail message; if `diff`, show the diff portion only.
Defaults to `raw`.
--allow-empty::
After a patch failure on an input e-mail message lacking a patch,
create an empty commit with the contents of the e-mail message
as its log message.
DISCUSSION
----------
The commit author name is taken from the "From: " line of the
message, and commit author date is taken from the "Date: " line
of the message. The "Subject: " line is used as the title of
the commit, after stripping common prefix "[PATCH <anything>]".
The "Subject: " line is supposed to concisely describe what the
commit is about in one line of text.
"From: ", "Date: ", and "Subject: " lines starting the body override the
respective commit author name and title values taken from the headers.
The commit message is formed by the title taken from the
"Subject: ", a blank line and the body of the message up to
where the patch begins. Excess whitespace at the end of each
line is automatically stripped.
The patch is expected to be inline, directly following the
message. Any line that is of the form:
* three-dashes and end-of-line, or
* a line that begins with "diff -", or
* a line that begins with "Index: "
is taken as the beginning of a patch, and the commit log message
is terminated before the first occurrence of such a line.
When initially invoking `git am`, you give it the names of the mailboxes
to process. Upon seeing the first patch that does not apply, it
aborts in the middle. You can recover from this in one of two ways:
. skip the current patch by re-running the command with the `--skip`
option.
. hand resolve the conflict in the working directory, and update
the index file to bring it into a state that the patch should
have produced. Then run the command with the `--continue` option.
The command refuses to process new mailboxes until the current
operation is finished, so if you decide to start over from scratch,
run `git am --abort` before running the command with mailbox
names.
Before any patches are applied, ORIG_HEAD is set to the tip of the
current branch. This is useful if you have problems with multiple
commits, like running 'git am' on the wrong branch or an error in the
commits that is more easily fixed by changing the mailbox (e.g.
errors in the "From:" lines).
HOOKS
-----
This command can run `applypatch-msg`, `pre-applypatch`,
and `post-applypatch` hooks. See linkgit:githooks[5] for more
information.
CONFIGURATION
-------------
include::includes/cmd-config-section-all.adoc[]
include::config/am.adoc[]
SEE ALSO
--------
linkgit:git-apply[1],
linkgit:git-format-patch[1].
GIT
---
Part of the linkgit:git[1] suite