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] [--dotest=<dir>] [--keep] [--utf8 | --no-utf8]
10                    [--3way] [--interactive] [--binary]
11                    [--whitespace=<option>] [-C<n>] [-p<n>]
12                    <mbox>|<Maildir>...
13           git-am [--skip | --resolved]
14

DESCRIPTION

16       Splits mail messages in a mailbox into commit log message, authorship
17       information and patches, and applies them to the current branch.
18

OPTIONS

20       <mbox>|<Maildir>...
21           The list of mailbox files to read patches from. If you do not
22           supply this argument, reads from the standard input. If you supply
23           directories, they´ll be treated as Maildirs.
24
25       -s, --signoff
26           Add Signed-off-by: line to the commit message, using the committer
27           identity of yourself.
28
29       -d=<dir>, --dotest=<dir>
30           Instead of .dotest directory, use <dir> as a working area to store
31           extracted patches.
32
33       -k, --keep
34           Pass -k flag to git-mailinfo (see git-mailinfo(1)).
35
36       -u, --utf8
37           Pass -u flag to git-mailinfo (see git-mailinfo(1)). The proposed
38           commit log message taken from the e-mail is re-coded into UTF-8
39           encoding (configuration variable i18n.commitencoding can be used to
40           specify project´s preferred encoding if it is not UTF-8).
41
42           This was optional in prior versions of git, but now it is the
43           default. You could use --no-utf8 to override this.
44
45       --no-utf8
46           Pass -n flag to git-mailinfo (see git-mailinfo(1)).
47
48       -3, --3way
49           When the patch does not apply cleanly, fall back on 3-way merge, if
50           the patch records the identity of blobs it is supposed to apply to,
51           and we have those blobs available locally.
52
53       -b, --binary
54           Pass --allow-binary-replacement flag to git-apply (see git-
55           apply(1)).
56
57       --whitespace=<option>
58           This flag is passed to the git-apply (see git-apply(1)) program
59           that applies the patch.
60
61       -C<n>, -p<n>
62           These flags are passed to the git-apply (see git-apply(1)) program
63           that applies the patch.
64
65       -i, --interactive
66           Run interactively.
67
68       --skip
69           Skip the current patch. This is only meaningful when restarting an
70           aborted patch.
71
72       -r, --resolved
73           After a patch failure (e.g. attempting to apply conflicting patch),
74           the user has applied it by hand and the index file stores the
75           result of the application. Make a commit using the authorship and
76           commit log extracted from the e-mail message and the current index
77           file, and continue.
78
79       --resolvemsg=<msg>
80           When a patch failure occurs, <msg> will be printed to the screen
81           before exiting. This overrides the standard message informing you
82           to use --resolved or --skip to handle the failure. This is solely
83           for internal use between git-rebase and git-am.
84

DISCUSSION

86       The commit author name is taken from the "From: " line of the message,
87       and commit author time is taken from the "Date: " line of the message.
88       The "Subject: " line is used as the title of the commit, after
89       stripping common prefix "[PATCH <anything>]". It is supposed to
90       describe what the commit is about concisely as a one line text.
91
92       The body of the message (iow, after a blank line that terminates
93       RFC2822 headers) can begin with "Subject: " and "From: " lines that are
94       different from those of the mail header, to override the values of
95       these fields.
96
97       The commit message is formed by the title taken from the "Subject: ", a
98       blank line and the body of the message up to where the patch begins.
99       Excess whitespaces at the end of the lines are automatically stripped.
100
101       The patch is expected to be inline, directly following the message. Any
102       line that is of form:
103
104
105       ·   three-dashes and end-of-line, or
106
107       ·   a line that begins with "diff -", or
108
109       ·   a line that begins with "Index: "
110       is taken as the beginning of a patch, and the commit log message is
111       terminated before the first occurrence of such a line.
112
113       When initially invoking it, you give it names of the mailboxes to
114       crunch. Upon seeing the first patch that does not apply, it aborts in
115       the middle,. You can recover from this in one of two ways:
116
117
118        1.  skip the current patch by re-running the command with --skip
119           option.
120
121        2.  hand resolve the conflict in the working directory, and update the
122           index file to bring it in a state that the patch should have
123           produced. Then run the command with --resolved option.
124       The command refuses to process new mailboxes while .dotest directory
125       exists, so if you decide to start over from scratch, run rm -f .dotest
126       before running the command with mailbox names.
127

SEE ALSO

129       git-apply(1).
130

AUTHOR

132       Written by Junio C Hamano <junkio@cox.net>
133

DOCUMENTATION

135       Documentation by Petr Baudis, Junio C Hamano and the git-list
136       <git@vger.kernel.org>.
137

GIT

139       Part of the git(7) suite
140
141
142
143
144Git 1.5.3.3                       10/09/2007                         GIT-AM(1)
Impressum