Skip to content

Instantly share code, notes, and snippets.

@shuhei
Last active August 29, 2015 14:17
Show Gist options
  • Save shuhei/49c31c28c42d4819cbf2 to your computer and use it in GitHub Desktop.
Save shuhei/49c31c28c42d4819cbf2 to your computer and use it in GitHub Desktop.
Create a patch branch from a branch that is so messed up that you cannot rebase/squash.
git checkout -b working $PARENT_COMMIT_OF_YOUR_FEATURE_BRANCH
git diff working your-feature-branch | git apply
git add .
git commit
git branch -M your-feature-branch your-feature-branch-org
git branch -M working your-feature-branch
git push --force origin your-feature-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment