Progress:
TIER 1 · MODULE 38· Basics

git am

The receiving end of format-patch.

🎯 What & why

Apply a mailbox of patches as commits. The receiving end of format-patch + send-email.

🧠 Mental model

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.

🛠️ Synopsis

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)

🎚️ Switches & options

FlagWhat it does
-3, --3wayUse 3-way merge if a patch doesn't apply cleanly.
-sAdd Signed-off-by: to each commit.
--abortRestore pre-am state.
--continueResume after fixing a conflict.

💡 Use cases

🧪 Examples

Apply patches from a directory.
$ git am /tmp/patches/*.patch
With 3-way merge fallback.
$ git am -3 series.mbox
Bail out.
$ git am --abort

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.