Skip to content

Instantly share code, notes, and snippets.

@skounis
Created March 10, 2022 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skounis/92d2a5b69af60003e51ee3d16263be7b to your computer and use it in GitHub Desktop.
Save skounis/92d2a5b69af60003e51ee3d16263be7b to your computer and use it in GitHub Desktop.
Generate git patches
# Generate patch for last commit
git format-patch -1 HEAD
# Generate patches for last 2 commits
git format-patch -2 HEAD
# Combine the changes of the last 2 commits into on patch file
git format-patch -2 HEAD --stdout > combined.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment