Skip to content

Instantly share code, notes, and snippets.

@DerPauli
Created September 16, 2025 10:56
Show Gist options
  • Save DerPauli/4cdf67e9ad58cb9acd25f17d5ba8487e to your computer and use it in GitHub Desktop.
Save DerPauli/4cdf67e9ad58cb9acd25f17d5ba8487e to your computer and use it in GitHub Desktop.
Create a git patch on a folder
# create patch
git diff origin/main..origin/<branch-to-compare> -- folder/to/patch/ another.file > my.patch
# apply the patch
patch -p1 < my.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment