Skip to content

Instantly share code, notes, and snippets.

@jms
Created June 4, 2020 17:55
Show Gist options
  • Save jms/b8b0bcb002ce914f4981e4a32115f6f6 to your computer and use it in GitHub Desktop.
Save jms/b8b0bcb002ce914f4981e4a32115f6f6 to your computer and use it in GitHub Desktop.
# generate a patch from you feature branch
git checkout feature-branch
git format-patch --stdout [development branch] > feature-branch.patch
# verify the patch
git apply --stat feature-branch.patch
# dry run to detect errors:
git apply --check feature-branch.patch
# apply the patch to a new branch
git checkout -b new-branch
git am feature-branch.patch
# apply the patch to a new branch using signoff, useful
git am --signoff < feature-branch.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment