Skip to content

Instantly share code, notes, and snippets.

@jomurgel
Created February 9, 2021 14:48
Show Gist options
  • Save jomurgel/9366a93fde97466cf0f539ec13388ade to your computer and use it in GitHub Desktop.
Save jomurgel/9366a93fde97466cf0f539ec13388ade to your computer and use it in GitHub Desktop.
Create and apply patch from branch diff
# Compare the changes against main.
git diff main BRANCH_W_CHANGES_NAME > ./temp_patch
# Checkout to a new branch and apply the patch.
git checkout NEW_BRANCH_NAME && git apply ./temp_patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment