Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 1 | git-am(1) |
Junio C Hamano | 05625af | 2005-10-21 20:57:34 -0700 | [diff] [blame] | 2 | ========= |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | c3f0baa | 2007-01-18 15:53:37 -0800 | [diff] [blame] | 6 | git-am - Apply a series of patches from a mailbox |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 11 | [verse] |
Thierry Reding | 566902f | 2022-11-30 18:28:33 +0100 | [diff] [blame] | 12 | 'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8] [--no-verify] |
Remi Lespinet | e97a5e7 | 2015-08-04 22:19:26 +0800 | [diff] [blame] | 13 | [--[no-]3way] [--interactive] [--committer-date-is-author-date] |
Giuseppe Bilotta | 86c91f9 | 2009-08-04 13:16:49 +0200 | [diff] [blame] | 14 | [--ignore-date] [--ignore-space-change | --ignore-whitespace] |
Junio C Hamano | 14d569b | 2023-10-18 16:35:06 -0700 | [diff] [blame] | 15 | [--whitespace=<action>] [-C<n>] [-p<n>] [--directory=<dir>] |
Johannes Berg | 58725ef | 2012-03-28 13:11:28 +0200 | [diff] [blame] | 16 | [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet] |
Junio C Hamano | 2dfefe0 | 2014-03-25 11:01:31 -0700 | [diff] [blame] | 17 | [--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>] |
Đoàn Trần Công Danh | 59b519a | 2021-05-10 00:12:13 +0700 | [diff] [blame] | 18 | [--quoted-cr=<action>] |
徐沛文 (Aleen) | 7c096b8 | 2021-12-09 07:25:54 +0000 | [diff] [blame] | 19 | [--empty=(stop|drop|keep)] |
Štěpán Němec | 0adda93 | 2010-10-08 19:31:17 +0200 | [diff] [blame] | 20 | [(<mbox> | <Maildir>)...] |
Jeff King | 53ce2e3 | 2024-06-06 04:21:14 -0400 | [diff] [blame] | 21 | 'git am' (--continue | --skip | --abort | --quit | --retry | --show-current-patch[=(diff|raw)] | --allow-empty) |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 22 | |
| 23 | DESCRIPTION |
| 24 | ----------- |
Elijah Newren | 6cc668c | 2023-10-08 06:45:14 +0000 | [diff] [blame] | 25 | Splits mail messages in a mailbox into commit log messages, |
Elijah Newren | 4d54268 | 2023-10-08 06:45:24 +0000 | [diff] [blame] | 26 | authorship information, and patches, and applies them to the |
Junio C Hamano | 9b0c7f3 | 2023-03-21 10:27:08 -0700 | [diff] [blame] | 27 | current branch. You could think of it as a reverse operation |
| 28 | of linkgit:git-format-patch[1] run on a branch with a straight |
| 29 | history without merges. |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 30 | |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 31 | OPTIONS |
| 32 | ------- |
Štěpán Němec | 0adda93 | 2010-10-08 19:31:17 +0200 | [diff] [blame] | 33 | (<mbox>|<Maildir>)...:: |
Michael S. Tsirkin | d414461 | 2007-02-09 12:23:23 +0200 | [diff] [blame] | 34 | The list of mailbox files to read patches from. If you do not |
David J. Mellor | 07f5746 | 2009-03-01 22:37:41 -0800 | [diff] [blame] | 35 | supply this argument, the command reads from the standard input. |
| 36 | If you supply directories, they will be treated as Maildirs. |
Michael S. Tsirkin | d414461 | 2007-02-09 12:23:23 +0200 | [diff] [blame] | 37 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 38 | -s:: |
| 39 | --signoff:: |
Bradley M. Kuhn | 3abd4a6 | 2020-10-19 18:03:55 -0700 | [diff] [blame] | 40 | Add a `Signed-off-by` trailer to the commit message, using |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 41 | the committer identity of yourself. |
David A. Wheeler | b2c150d | 2016-01-05 14:20:26 -0500 | [diff] [blame] | 42 | See the signoff option in linkgit:git-commit[1] for more information. |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 43 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 44 | -k:: |
| 45 | --keep:: |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 46 | Pass `-k` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]). |
Junio C Hamano | d84029b | 2007-01-08 13:59:15 -0800 | [diff] [blame] | 47 | |
Thomas Rast | f7e5ea1 | 2012-01-16 11:53:00 +0100 | [diff] [blame] | 48 | --keep-non-patch:: |
| 49 | Pass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]). |
| 50 | |
Felipe Contreras | 0460ed2 | 2013-05-08 20:16:55 -0500 | [diff] [blame] | 51 | --[no-]keep-cr:: |
Stefan-W. Hahn | ad2c928 | 2010-02-27 15:20:26 +0100 | [diff] [blame] | 52 | With `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1]) |
| 53 | with the same option, to prevent it from stripping CR at the end of |
Stefan-W. Hahn | e80d4cb | 2010-02-27 15:20:27 +0100 | [diff] [blame] | 54 | lines. `am.keepcr` configuration variable can be used to specify the |
| 55 | default behaviour. `--no-keep-cr` is useful to override `am.keepcr`. |
Stefan-W. Hahn | ad2c928 | 2010-02-27 15:20:26 +0100 | [diff] [blame] | 56 | |
Junio C Hamano | 017678b | 2009-08-26 21:36:05 -0700 | [diff] [blame] | 57 | -c:: |
| 58 | --scissors:: |
| 59 | Remove everything in body before a scissors line (see |
Matthieu Moy | afb5de7 | 2015-02-20 20:32:21 +0100 | [diff] [blame] | 60 | linkgit:git-mailinfo[1]). Can be activated by default using |
| 61 | the `mailinfo.scissors` configuration variable. |
Junio C Hamano | 017678b | 2009-08-26 21:36:05 -0700 | [diff] [blame] | 62 | |
Michal Sojka | 8024d59 | 2010-03-04 13:08:28 +0100 | [diff] [blame] | 63 | --no-scissors:: |
Nicolas Sebrecht | 434a6db | 2009-09-11 02:29:58 +0200 | [diff] [blame] | 64 | Ignore scissors lines (see linkgit:git-mailinfo[1]). |
| 65 | |
Đoàn Trần Công Danh | 59b519a | 2021-05-10 00:12:13 +0700 | [diff] [blame] | 66 | --quoted-cr=<action>:: |
| 67 | This flag will be passed down to 'git mailinfo' (see linkgit:git-mailinfo[1]). |
| 68 | |
Brian Lyles | 64a443e | 2024-03-25 18:16:49 -0500 | [diff] [blame] | 69 | --empty=(drop|keep|stop):: |
| 70 | How to handle an e-mail message lacking a patch: |
| 71 | + |
| 72 | -- |
| 73 | `drop`;; |
| 74 | The e-mail message will be skipped. |
| 75 | `keep`;; |
| 76 | An empty commit will be created, with the contents of the e-mail |
| 77 | message as its log. |
| 78 | `stop`;; |
| 79 | The command will fail, stopping in the middle of the current `am` |
| 80 | session. This is the default behavior. |
| 81 | -- |
徐沛文 (Aleen) | 7c096b8 | 2021-12-09 07:25:54 +0000 | [diff] [blame] | 82 | |
Paolo Bonzini | a078f73 | 2014-11-25 15:00:56 +0100 | [diff] [blame] | 83 | -m:: |
| 84 | --message-id:: |
| 85 | Pass the `-m` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]), |
| 86 | so that the Message-ID header is added to the commit message. |
| 87 | The `am.messageid` configuration variable can be used to specify |
| 88 | the default behaviour. |
| 89 | |
| 90 | --no-message-id:: |
| 91 | Do not add the Message-ID header to the commit message. |
| 92 | `no-message-id` is useful to override `am.messageid`. |
| 93 | |
Stephen Boyd | 0e987a1 | 2009-06-16 15:33:01 -0700 | [diff] [blame] | 94 | -q:: |
| 95 | --quiet:: |
| 96 | Be quiet. Only print error messages. |
| 97 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 98 | -u:: |
| 99 | --utf8:: |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 100 | Pass `-u` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]). |
Junio C Hamano | d84029b | 2007-01-08 13:59:15 -0800 | [diff] [blame] | 101 | The proposed commit log message taken from the e-mail |
Frank Lichtenheld | 870e0d6 | 2007-05-14 16:44:53 +0200 | [diff] [blame] | 102 | is re-coded into UTF-8 encoding (configuration variable |
Elijah Newren | 0a4f051 | 2023-10-08 06:45:17 +0000 | [diff] [blame] | 103 | `i18n.commitEncoding` can be used to specify the project's |
Junio C Hamano | d84029b | 2007-01-08 13:59:15 -0800 | [diff] [blame] | 104 | preferred encoding if it is not UTF-8). |
| 105 | + |
| 106 | This was optional in prior versions of git, but now it is the |
David J. Mellor | 07f5746 | 2009-03-01 22:37:41 -0800 | [diff] [blame] | 107 | default. You can use `--no-utf8` to override this. |
Junio C Hamano | d84029b | 2007-01-08 13:59:15 -0800 | [diff] [blame] | 108 | |
| 109 | --no-utf8:: |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 110 | Pass `-n` flag to 'git mailinfo' (see |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 111 | linkgit:git-mailinfo[1]). |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 112 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 113 | -3:: |
| 114 | --3way:: |
Remi Lespinet | e97a5e7 | 2015-08-04 22:19:26 +0800 | [diff] [blame] | 115 | --no-3way:: |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 116 | When the patch does not apply cleanly, fall back on |
David J. Mellor | 07f5746 | 2009-03-01 22:37:41 -0800 | [diff] [blame] | 117 | 3-way merge if the patch records the identity of blobs |
| 118 | it is supposed to apply to and we have those blobs |
Remi Lespinet | e97a5e7 | 2015-08-04 22:19:26 +0800 | [diff] [blame] | 119 | available locally. `--no-3way` can be used to override |
| 120 | am.threeWay configuration variable. For more information, |
| 121 | see am.threeWay in linkgit:git-config[1]. |
Frank Lichtenheld | 870e0d6 | 2007-05-14 16:44:53 +0200 | [diff] [blame] | 122 | |
Junio C Hamano | 0dbc715 | 2022-07-15 14:32:18 -0700 | [diff] [blame] | 123 | include::rerere-options.txt[] |
Phillip Wood | aba4954 | 2019-03-14 19:12:32 +0000 | [diff] [blame] | 124 | |
Giuseppe Bilotta | 86c91f9 | 2009-08-04 13:16:49 +0200 | [diff] [blame] | 125 | --ignore-space-change:: |
| 126 | --ignore-whitespace:: |
Junio C Hamano | 14d569b | 2023-10-18 16:35:06 -0700 | [diff] [blame] | 127 | --whitespace=<action>:: |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 128 | -C<n>:: |
| 129 | -p<n>:: |
Junio C Hamano | b47dfe9 | 2009-01-11 22:21:48 -0800 | [diff] [blame] | 130 | --directory=<dir>:: |
maximilian attems | 2ae7345 | 2011-08-09 17:21:08 +0200 | [diff] [blame] | 131 | --exclude=<path>:: |
Johannes Berg | 58725ef | 2012-03-28 13:11:28 +0200 | [diff] [blame] | 132 | --include=<path>:: |
martin f. krafft | b80da42 | 2009-01-23 11:31:21 +1100 | [diff] [blame] | 133 | --reject:: |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 134 | These flags are passed to the 'git apply' (see linkgit:git-apply[1]) |
Frank Lichtenheld | 870e0d6 | 2007-05-14 16:44:53 +0200 | [diff] [blame] | 135 | program that applies |
| 136 | the patch. |
Junio C Hamano | a171dac | 2024-02-14 10:44:01 -0800 | [diff] [blame] | 137 | + |
| 138 | Valid <action> for the `--whitespace` option are: |
| 139 | `nowarn`, `warn`, `fix`, `error`, and `error-all`. |
Frank Lichtenheld | 870e0d6 | 2007-05-14 16:44:53 +0200 | [diff] [blame] | 140 | |
Chris Packham | 6498137 | 2014-03-11 16:51:57 +1300 | [diff] [blame] | 141 | --patch-format:: |
| 142 | By default the command will try to detect the patch format |
| 143 | automatically. This option allows the user to bypass the automatic |
| 144 | detection and specify the patch format that the patch(es) should be |
Eric Wong | d9925d1 | 2016-06-05 04:46:41 +0000 | [diff] [blame] | 145 | interpreted as. Valid formats are mbox, mboxrd, |
Elijah Newren | 4d54268 | 2023-10-08 06:45:24 +0000 | [diff] [blame] | 146 | stgit, stgit-series, and hg. |
Chris Packham | 6498137 | 2014-03-11 16:51:57 +1300 | [diff] [blame] | 147 | |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 148 | -i:: |
| 149 | --interactive:: |
Frank Lichtenheld | 870e0d6 | 2007-05-14 16:44:53 +0200 | [diff] [blame] | 150 | Run interactively. |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 151 | |
Thierry Reding | 566902f | 2022-11-30 18:28:33 +0100 | [diff] [blame] | 152 | -n:: |
| 153 | --no-verify:: |
| 154 | By default, the pre-applypatch and applypatch-msg hooks are run. |
| 155 | When any of `--no-verify` or `-n` is given, these are bypassed. |
| 156 | See also linkgit:githooks[5]. |
| 157 | |
Nanako Shiraishi | a79ec62 | 2009-01-24 10:18:02 +0900 | [diff] [blame] | 158 | --committer-date-is-author-date:: |
| 159 | By default the command records the date from the e-mail |
| 160 | message as the commit author date, and uses the time of |
| 161 | commit creation as the committer date. This allows the |
| 162 | user to lie about the committer date by using the same |
Stephen Boyd | e77063f | 2009-05-04 22:19:00 -0700 | [diff] [blame] | 163 | value as the author date. |
Nanako Shiraishi | a79ec62 | 2009-01-24 10:18:02 +0900 | [diff] [blame] | 164 | |
| 165 | --ignore-date:: |
| 166 | By default the command records the date from the e-mail |
| 167 | message as the commit author date, and uses the time of |
| 168 | commit creation as the committer date. This allows the |
Stephen Boyd | e77063f | 2009-05-04 22:19:00 -0700 | [diff] [blame] | 169 | user to lie about the author date by using the same |
| 170 | value as the committer date. |
Nanako Shiraishi | a79ec62 | 2009-01-24 10:18:02 +0900 | [diff] [blame] | 171 | |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 172 | --skip:: |
| 173 | Skip the current patch. This is only meaningful when |
| 174 | restarting an aborted patch. |
| 175 | |
Nicolas Vigier | 3b4e395f | 2014-02-01 02:18:01 +0000 | [diff] [blame] | 176 | -S[<keyid>]:: |
| 177 | --gpg-sign[=<keyid>]:: |
Đoàn Trần Công Danh | ae06ba6 | 2020-04-03 17:28:04 +0700 | [diff] [blame] | 178 | --no-gpg-sign:: |
Matthieu Moy | 2b594bf | 2015-09-19 09:47:50 +0200 | [diff] [blame] | 179 | GPG-sign commits. The `keyid` argument is optional and |
| 180 | defaults to the committer identity; if specified, it must be |
Đoàn Trần Công Danh | ae06ba6 | 2020-04-03 17:28:04 +0700 | [diff] [blame] | 181 | stuck to the option without a space. `--no-gpg-sign` is useful to |
| 182 | countermand both `commit.gpgSign` configuration variable, and |
| 183 | earlier `--gpg-sign`. |
Nicolas Vigier | 3b4e395f | 2014-02-01 02:18:01 +0000 | [diff] [blame] | 184 | |
Jeff King | c8089af | 2010-02-11 17:27:14 -0500 | [diff] [blame] | 185 | --continue:: |
Stephan Beyer | 3240240 | 2008-06-08 03:36:09 +0200 | [diff] [blame] | 186 | -r:: |
| 187 | --resolved:: |
Junio C Hamano | 087b674 | 2005-11-16 16:46:24 -0800 | [diff] [blame] | 188 | After a patch failure (e.g. attempting to apply |
| 189 | conflicting patch), the user has applied it by hand and |
| 190 | the index file stores the result of the application. |
| 191 | Make a commit using the authorship and commit log |
| 192 | extracted from the e-mail message and the current index |
| 193 | file, and continue. |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 194 | |
Andrew Ruder | 5c19f24 | 2007-04-16 02:21:31 -0500 | [diff] [blame] | 195 | --resolvemsg=<msg>:: |
| 196 | When a patch failure occurs, <msg> will be printed |
| 197 | to the screen before exiting. This overrides the |
Kevin Bracey | 8ceb6fb | 2013-06-26 23:06:41 +0300 | [diff] [blame] | 198 | standard message informing you to use `--continue` |
Andrew Ruder | 5c19f24 | 2007-04-16 02:21:31 -0500 | [diff] [blame] | 199 | or `--skip` to handle the failure. This is solely |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 200 | for internal use between 'git rebase' and 'git am'. |
Andrew Ruder | 5c19f24 | 2007-04-16 02:21:31 -0500 | [diff] [blame] | 201 | |
Nanako Shiraishi | 3e5057a | 2008-07-16 19:39:10 +0900 | [diff] [blame] | 202 | --abort:: |
| 203 | Restore the original branch and abort the patching operation. |
Elijah Newren | 0a4f051 | 2023-10-08 06:45:17 +0000 | [diff] [blame] | 204 | Revert the contents of files involved in the am operation to their |
Elijah Newren | ea7dc01 | 2021-09-10 10:31:14 +0000 | [diff] [blame] | 205 | pre-am state. |
Nanako Shiraishi | 3e5057a | 2008-07-16 19:39:10 +0900 | [diff] [blame] | 206 | |
Nguyễn Thái Ngọc Duy | 65ed8ff | 2018-02-14 18:16:06 +0700 | [diff] [blame] | 207 | --quit:: |
| 208 | Abort the patching operation but keep HEAD and the index |
| 209 | untouched. |
| 210 | |
Jeff King | 53ce2e3 | 2024-06-06 04:21:14 -0400 | [diff] [blame] | 211 | --retry:: |
| 212 | Try to apply the last conflicting patch again. This is generally |
| 213 | only useful for passing extra options to the retry attempt |
| 214 | (e.g., `--3way`), since otherwise you'll just see the same |
| 215 | failure again. |
| 216 | |
Paolo Bonzini | aa416b2 | 2020-02-20 15:15:19 +0100 | [diff] [blame] | 217 | --show-current-patch[=(diff|raw)]:: |
| 218 | Show the message at which `git am` has stopped due to |
| 219 | conflicts. If `raw` is specified, show the raw contents of |
| 220 | the e-mail message; if `diff`, show the diff portion only. |
| 221 | Defaults to `raw`. |
Nguyễn Thái Ngọc Duy | 984913a | 2018-02-11 16:43:26 +0700 | [diff] [blame] | 222 | |
徐沛文 (Aleen) | 9e7e41b | 2021-12-09 07:25:55 +0000 | [diff] [blame] | 223 | --allow-empty:: |
| 224 | After a patch failure on an input e-mail message lacking a patch, |
| 225 | create an empty commit with the contents of the e-mail message |
| 226 | as its log message. |
| 227 | |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 228 | DISCUSSION |
| 229 | ---------- |
| 230 | |
Junio C Hamano | 2499857 | 2007-03-24 03:08:54 -0700 | [diff] [blame] | 231 | The commit author name is taken from the "From: " line of the |
Stephen Boyd | e77063f | 2009-05-04 22:19:00 -0700 | [diff] [blame] | 232 | message, and commit author date is taken from the "Date: " line |
Junio C Hamano | 2499857 | 2007-03-24 03:08:54 -0700 | [diff] [blame] | 233 | of the message. The "Subject: " line is used as the title of |
| 234 | the commit, after stripping common prefix "[PATCH <anything>]". |
Stephen Boyd | 3db964b | 2009-05-04 22:18:42 -0700 | [diff] [blame] | 235 | The "Subject: " line is supposed to concisely describe what the |
| 236 | commit is about in one line of text. |
Junio C Hamano | 2499857 | 2007-03-24 03:08:54 -0700 | [diff] [blame] | 237 | |
Paul Menzel | f8740c5 | 2020-01-03 16:05:46 +0100 | [diff] [blame] | 238 | "From: ", "Date: ", and "Subject: " lines starting the body override the |
| 239 | respective commit author name and title values taken from the headers. |
Junio C Hamano | 2499857 | 2007-03-24 03:08:54 -0700 | [diff] [blame] | 240 | |
| 241 | The commit message is formed by the title taken from the |
| 242 | "Subject: ", a blank line and the body of the message up to |
Stephen Boyd | 3db964b | 2009-05-04 22:18:42 -0700 | [diff] [blame] | 243 | where the patch begins. Excess whitespace at the end of each |
| 244 | line is automatically stripped. |
Junio C Hamano | 2499857 | 2007-03-24 03:08:54 -0700 | [diff] [blame] | 245 | |
| 246 | The patch is expected to be inline, directly following the |
David J. Mellor | 07f5746 | 2009-03-01 22:37:41 -0800 | [diff] [blame] | 247 | message. Any line that is of the form: |
Junio C Hamano | 2499857 | 2007-03-24 03:08:54 -0700 | [diff] [blame] | 248 | |
| 249 | * three-dashes and end-of-line, or |
| 250 | * a line that begins with "diff -", or |
| 251 | * a line that begins with "Index: " |
| 252 | |
| 253 | is taken as the beginning of a patch, and the commit log message |
| 254 | is terminated before the first occurrence of such a line. |
| 255 | |
Stephen Boyd | 3db964b | 2009-05-04 22:18:42 -0700 | [diff] [blame] | 256 | When initially invoking `git am`, you give it the names of the mailboxes |
David J. Mellor | 07f5746 | 2009-03-01 22:37:41 -0800 | [diff] [blame] | 257 | to process. Upon seeing the first patch that does not apply, it |
| 258 | aborts in the middle. You can recover from this in one of two ways: |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 259 | |
Matthieu Moy | bcf9626 | 2016-06-28 13:40:11 +0200 | [diff] [blame] | 260 | . skip the current patch by re-running the command with the `--skip` |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 261 | option. |
| 262 | |
Junio C Hamano | 087b674 | 2005-11-16 16:46:24 -0800 | [diff] [blame] | 263 | . hand resolve the conflict in the working directory, and update |
David J. Mellor | 07f5746 | 2009-03-01 22:37:41 -0800 | [diff] [blame] | 264 | the index file to bring it into a state that the patch should |
Matthieu Moy | bcf9626 | 2016-06-28 13:40:11 +0200 | [diff] [blame] | 265 | have produced. Then run the command with the `--continue` option. |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 266 | |
SZEDER Gábor | b5f306f | 2011-03-22 19:42:25 +0100 | [diff] [blame] | 267 | The command refuses to process new mailboxes until the current |
| 268 | operation is finished, so if you decide to start over from scratch, |
| 269 | run `git am --abort` before running the command with mailbox |
Junio C Hamano | baa720f | 2005-10-20 22:14:14 -0700 | [diff] [blame] | 270 | names. |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 271 | |
Brian Gernhardt | 9869099 | 2008-07-08 00:12:22 -0400 | [diff] [blame] | 272 | Before any patches are applied, ORIG_HEAD is set to the tip of the |
| 273 | current branch. This is useful if you have problems with multiple |
| 274 | commits, like running 'git am' on the wrong branch or an error in the |
| 275 | commits that is more easily fixed by changing the mailbox (e.g. |
| 276 | errors in the "From:" lines). |
| 277 | |
Jonathan Nieder | 0e3d40c | 2014-02-24 12:38:29 -0800 | [diff] [blame] | 278 | HOOKS |
| 279 | ----- |
| 280 | This command can run `applypatch-msg`, `pre-applypatch`, |
| 281 | and `post-applypatch` hooks. See linkgit:githooks[5] for more |
| 282 | information. |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 283 | |
Ævar Arnfjörð Bjarmason | 16f6b0d | 2022-09-07 10:27:04 +0200 | [diff] [blame] | 284 | CONFIGURATION |
| 285 | ------------- |
| 286 | |
| 287 | include::includes/cmd-config-section-all.txt[] |
| 288 | |
| 289 | include::config/am.txt[] |
| 290 | |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 291 | SEE ALSO |
| 292 | -------- |
Junio C Hamano | 9b0c7f3 | 2023-03-21 10:27:08 -0700 | [diff] [blame] | 293 | linkgit:git-apply[1], |
| 294 | linkgit:git-format-patch[1]. |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 295 | |
Petr Baudis | 42e2cba | 2005-10-21 02:28:42 +0200 | [diff] [blame] | 296 | GIT |
| 297 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 298 | Part of the linkgit:git[1] suite |