Skip to the content.

Git Patch

Usage

Create Git Patch

... (git commit -m)
git format-patch -M <upstream-branch> <current-branch>.patch

Apply Git Patch

git am <current-branch>.patch
... (git add+commit)

Create Standard Patch

... (git commit)
git diff <upstream-branch> > <current-branch>.patch

Apply Standard Patch

git apply --check <current-branch>.patch
git apply <current-branch>.patch
... (git add+commit)

References