Home Explore Blog CI



git

1st chunk of `Documentation/git-am.adoc`
01f3527e975042626b30324990cd1c79c19884cc3a38996f0000000100000fae
git-am(1)
=========

NAME
----
git-am - Apply a series of patches from a mailbox


SYNOPSIS
--------
[verse]
'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8] [--no-verify]
	 [--[no-]3way] [--interactive] [--committer-date-is-author-date]
	 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
	 [--whitespace=<action>] [-C<n>] [-p<n>] [--directory=<dir>]
	 [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
	 [--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>]
	 [--quoted-cr=<action>]
	 [--empty=(stop|drop|keep)]
	 [(<mbox> | <Maildir>)...]
'git am' (--continue | --skip | --abort | --quit | --retry | --show-current-patch[=(diff|raw)] | --allow-empty)

DESCRIPTION
-----------
Splits mail messages in a mailbox into commit log messages,
authorship information, and patches, and applies them to the
current branch. You could think of it as a reverse operation
of linkgit:git-format-patch[1] run on a branch with a straight
history without merges.

OPTIONS
-------
(<mbox>|<Maildir>)...::
	The list of mailbox files to read patches from. If you do not
	supply this argument, the command reads from the standard input.
	If you supply directories, they will be treated as Maildirs.

-s::
--signoff::
	Add a `Signed-off-by` trailer to the commit message, using
	the committer identity of yourself.
	See the signoff option in linkgit:git-commit[1] for more information.

-k::
--keep::
	Pass `-k` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).

--keep-non-patch::
	Pass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).

--[no-]keep-cr::
	With `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])
	with the same option, to prevent it from stripping CR at the end of
	lines. `am.keepcr` configuration variable can be used to specify the
	default behaviour.  `--no-keep-cr` is useful to override `am.keepcr`.

-c::
--scissors::
	Remove everything in body before a scissors line (see
	linkgit:git-mailinfo[1]). Can be activated by default using
	the `mailinfo.scissors` configuration variable.

--no-scissors::
	Ignore scissors lines (see linkgit:git-mailinfo[1]).

--quoted-cr=<action>::
	This flag will be passed down to 'git mailinfo' (see linkgit:git-mailinfo[1]).

--empty=(drop|keep|stop)::
	How to handle an e-mail message lacking a patch:
+
--
`drop`;;
	The e-mail message will be skipped.
`keep`;;
	An empty commit will be created, with the contents of the e-mail
	message as its log.
`stop`;;
	The command will fail, stopping in the middle of the current `am`
	session. This is the default behavior.
--

-m::
--message-id::
	Pass the `-m` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]),
	so that the Message-ID header is added to the commit message.
	The `am.messageid` configuration variable can be used to specify
	the default behaviour.

--no-message-id::
	Do not add the Message-ID header to the commit message.
	`no-message-id` is useful to override `am.messageid`.

-q::
--quiet::
	Be quiet. Only print error messages.

-u::
--utf8::
	Pass `-u` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).
	The proposed commit log message taken from the e-mail
	is re-coded into UTF-8 encoding (configuration variable
	`i18n.commitEncoding` can be used to specify the project's
	preferred encoding if it is not UTF-8).
+
This was optional in prior versions of git, but now it is the
default.   You can use `--no-utf8` to override this.

--no-utf8::
	Pass `-n` flag to 'git mailinfo' (see
	linkgit:git-mailinfo[1]).

-3::
--3way::
--no-3way::
	When the patch does not apply cleanly, fall back on
	3-way merge if the patch records the identity of blobs
	it is supposed to apply to and we have those blobs
	available locally. `--no-3way` can be used to override
	am.threeWay configuration variable. For more information,
	see am.threeWay in linkgit:git-config[1].

include::rerere-options.adoc[]

--ignore-space-change::
--ignore-whitespace::
--whitespace=<action>::
-C<n>::
-p<n>::
--directory=<dir>::
--exclude=<path>::
--include=<path>::

Title: Git Am Command
Summary
The git-am command is used to apply a series of patches from a mailbox, splitting mail messages into commit log messages, authorship information, and patches, and applying them to the current branch, with various options for customization and error handling.