1GIT-AM(1)                         Git Manual                         GIT-AM(1)
2
3
4

NAME

6       git-am - Apply a series of patches from a mailbox
7

SYNOPSIS

9       git am [--signoff] [--keep] [--[no-]keep-cr] [--[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                [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
14                [--[no-]scissors]
15                [(<mbox> | <Maildir>)...]
16       git am (--continue | --skip | --abort)
17
18

DESCRIPTION

20       Splits mail messages in a mailbox into commit log message, authorship
21       information and patches, and applies them to the current branch.
22

OPTIONS

24       (<mbox>|<Maildir>)...
25           The list of mailbox files to read patches from. If you do not
26           supply this argument, the command reads from the standard input. If
27           you supply directories, they will be treated as Maildirs.
28
29       -s, --signoff
30           Add a Signed-off-by: line to the commit message, using the
31           committer identity of yourself.
32
33       -k, --keep
34           Pass -k flag to git mailinfo (see git-mailinfo(1)).
35
36       --keep-non-patch
37           Pass -b flag to git mailinfo (see git-mailinfo(1)).
38
39       --[no-]keep-cr
40           With --keep-cr, call git mailsplit (see git-mailsplit(1)) with the
41           same option, to prevent it from stripping CR at the end of lines.
42           am.keepcr configuration variable can be used to specify the default
43           behaviour.  --no-keep-cr is useful to override am.keepcr.
44
45       -c, --scissors
46           Remove everything in body before a scissors line (see git-
47           mailinfo(1)).
48
49       --no-scissors
50           Ignore scissors lines (see git-mailinfo(1)).
51
52       -q, --quiet
53           Be quiet. Only print error messages.
54
55       -u, --utf8
56           Pass -u flag to git mailinfo (see git-mailinfo(1)). The proposed
57           commit log message taken from the e-mail is re-coded into UTF-8
58           encoding (configuration variable i18n.commitencoding can be used to
59           specify project’s preferred encoding if it is not UTF-8).
60
61           This was optional in prior versions of git, but now it is the
62           default. You can use --no-utf8 to override this.
63
64       --no-utf8
65           Pass -n flag to git mailinfo (see git-mailinfo(1)).
66
67       -3, --3way
68           When the patch does not apply cleanly, fall back on 3-way merge if
69           the patch records the identity of blobs it is supposed to apply to
70           and we have those blobs available locally.
71
72       --ignore-date, --ignore-space-change, --ignore-whitespace,
73       --whitespace=<option>, -C<n>, -p<n>, --directory=<dir>,
74       --exclude=<path>, --include=<path>, --reject
75           These flags are passed to the git apply (see git-apply(1)) program
76           that applies the patch.
77
78       -i, --interactive
79           Run interactively.
80
81       --committer-date-is-author-date
82           By default the command records the date from the e-mail message as
83           the commit author date, and uses the time of commit creation as the
84           committer date. This allows the user to lie about the committer
85           date by using the same value as the author date.
86
87       --ignore-date
88           By default the command records the date from the e-mail message as
89           the commit author date, and uses the time of commit creation as the
90           committer date. This allows the user to lie about the author date
91           by using the same value as the committer date.
92
93       --skip
94           Skip the current patch. This is only meaningful when restarting an
95           aborted patch.
96
97       --continue, -r, --resolved
98           After a patch failure (e.g. attempting to apply conflicting patch),
99           the user has applied it by hand and the index file stores the
100           result of the application. Make a commit using the authorship and
101           commit log extracted from the e-mail message and the current index
102           file, and continue.
103
104       --resolvemsg=<msg>
105           When a patch failure occurs, <msg> will be printed to the screen
106           before exiting. This overrides the standard message informing you
107           to use --resolved or --skip to handle the failure. This is solely
108           for internal use between git rebase and git am.
109
110       --abort
111           Restore the original branch and abort the patching operation.
112

DISCUSSION

114       The commit author name is taken from the "From: " line of the message,
115       and commit author date is taken from the "Date: " line of the message.
116       The "Subject: " line is used as the title of the commit, after
117       stripping common prefix "[PATCH <anything>]". The "Subject: " line is
118       supposed to concisely describe what the commit is about in one line of
119       text.
120
121       "From: " and "Subject: " lines starting the body override the
122       respective commit author name and title values taken from the headers.
123
124       The commit message is formed by the title taken from the "Subject: ", a
125       blank line and the body of the message up to where the patch begins.
126       Excess whitespace at the end of each line is automatically stripped.
127
128       The patch is expected to be inline, directly following the message. Any
129       line that is of the form:
130
131       ·   three-dashes and end-of-line, or
132
133       ·   a line that begins with "diff -", or
134
135       ·   a line that begins with "Index: "
136
137       is taken as the beginning of a patch, and the commit log message is
138       terminated before the first occurrence of such a line.
139
140       When initially invoking git am, you give it the names of the mailboxes
141       to process. Upon seeing the first patch that does not apply, it aborts
142       in the middle. You can recover from this in one of two ways:
143
144        1. skip the current patch by re-running the command with the --skip
145           option.
146
147        2. hand resolve the conflict in the working directory, and update the
148           index file to bring it into a state that the patch should have
149           produced. Then run the command with the --resolved option.
150
151       The command refuses to process new mailboxes until the current
152       operation is finished, so if you decide to start over from scratch, run
153       git am --abort before running the command with mailbox names.
154
155       Before any patches are applied, ORIG_HEAD is set to the tip of the
156       current branch. This is useful if you have problems with multiple
157       commits, like running git am on the wrong branch or an error in the
158       commits that is more easily fixed by changing the mailbox (e.g. errors
159       in the "From:" lines).
160

SEE ALSO

162       git-apply(1).
163

GIT

165       Part of the git(1) suite
166
167
168
169Git 1.8.3.1                       11/19/2018                         GIT-AM(1)
Impressum