git format-patch / am
SafeMake and apply patches
git format-patch -1 <commit>
Exports commits as patch files and re-applies them with am — move changes across air gaps.
Examples
git format-patch -3 HEAD && git am *.patchCarry the last three commits
Syntax
git format-patch [-n] <rev> / git am <patch>
Before you run it
Files in, commits out.
Related commands
- git applyApply raw diffs
- git bundleRepo in a single file
- git cherry-pickApply specific commits
The same reference, with no signal at all
Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.
Get it free on the App Store