Skip to content

Instantly share code, notes, and snippets.

@kaiuwepeter
kaiuwepeter / git-apply-patch.md
Created December 19, 2025 10:27 — forked from emmanueltissera/git-apply-patch.md
Generate a git patch for a specific commit

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying