Skip to content

Instantly share code, notes, and snippets.

@paranlee
Forked from stokito/create_patch.sh
Created August 16, 2022 05:23
Show Gist options
  • Save paranlee/93eea7d257e7e5e4f5d90396428ec002 to your computer and use it in GitHub Desktop.
Save paranlee/93eea7d257e7e5e4f5d90396428ec002 to your computer and use it in GitHub Desktop.
git: create a single patch file with multiple commits
# last three commits
git format-patch -3 --stdout > multi_commit.patch
# all commits that are in your branch and not in master into a single patch file multi_commit.patch
git format-patch --signoff master --stdout > multi_commit.patch
# create patches in the folder ~/output/directory/ for all commits that are in your branch and not in master
git format-patch -o ~/output/directory/ --signoff master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment