The receiving end of format-patch.
Apply a mailbox of patches as commits. The receiving end of format-patch + send-email.
am parses each email in the mbox, extracts the patch and metadata, calls git apply to mutate the working tree + index, then commits with the original author/message. State (which patch is up next) lives in .git/rebase-apply/ until the queue empties or you --abort.
git am [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8] [--no-verify]
[--3way] [--interactive] [--committer-date-is-author-date]
[--ignore-date] [--ignore-space-change | --ignore-whitespace]
[--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
[--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
[--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>]
[(<mbox> | <Maildir>)...]
git am (--continue | --skip | --abort | --quit | --retry | --show-current-patch[=(diff|raw)] | --allow-empty)| Flag | What it does |
|---|---|
-3, --3way | Use 3-way merge if a patch doesn't apply cleanly. |
-s | Add Signed-off-by: to each commit. |
--abort | Restore pre-am state. |
--continue | Resume after fixing a conflict. |
$ git am /tmp/patches/*.patch$ git am -3 series.mbox$ git am --abort-3 — way better than failing on whitespace nits.--skip or --abort instead of forcing it.--continue. A bare commit won't move the queue.Hit each option, then Check answers. Score is recorded; Next is always open.