Skip to content

Instantly share code, notes, and snippets.

@defilerc
Created May 9, 2018 14:19
Show Gist options
  • Save defilerc/a5d5a56240ede95bed95b0f176d53fa5 to your computer and use it in GitHub Desktop.
Save defilerc/a5d5a56240ede95bed95b0f176d53fa5 to your computer and use it in GitHub Desktop.
git: create patch between branches and apply
# checkout branch with changes
# --stdout used to produce 1 diff file, instead of n, where n # of commits.
git format-patch [branch_to_compare_to] --stdout > all.patch
# checkout to new branch. apply patch created
git apply all.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment