LinuxCommandLibrary

git-am

Apply patches from email messages in mbox format

TLDR

Apply patches from mailbox

$ git am [patches.mbox]
copy
Apply patch files
$ git am [*.patch]
copy
Apply with 3-way merge
$ git am --3way [patch]
copy
Skip current patch
$ git am --skip
copy
Abort patch application
$ git am --abort
copy

SYNOPSIS

git am [options] [mbox|maildir]

DESCRIPTION

git am (apply mailbox) applies patches from email messages. It reads patches in mbox format, commonly used for email-based patch submission workflows in open source projects.
The command extracts patch content and commit message from email format, creating commits with the original author information preserved. It handles patch series and manages conflicts through --skip, --abort, and --continue operations.
This workflow remains fundamental to the Linux kernel development process and other projects that rely on email-based code review and patch submission.

PARAMETERS

MBOX

Mailbox file with patches.
--3way, -3
Fall back to 3-way merge.
--skip
Skip the current patch.
--abort
Abort and restore original branch.
--continue
Continue after resolving conflicts.
--signoff
Add Signed-off-by line.
-i, --interactive
Run interactively.
--help
Display help information.

CAVEATS

Patch format must be correct. Conflicts require manual resolution. Original commit dates preserved.

HISTORY

git am was designed for the Linux kernel development workflow where patches are submitted and reviewed via email on mailing lists.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community