Skip to content

Instantly share code, notes, and snippets.

@duellj
Last active December 18, 2015 18:39
Show Gist options
  • Save duellj/5827432 to your computer and use it in GitHub Desktop.
Save duellj/5827432 to your computer and use it in GitHub Desktop.
Drupal.org patch rerolls
# Create a branch at a date near patch creation
git co -b issue-x `git log -1 --before=[date of patch, e.g. 6/1/2013] --format=format:%h`
# Apply patch and commit
curl [patch url] | patch -p1
git add -A .
git ci -m 'Patch from #comment'
# Rebase to current 8.x HEAD
git rebase 8.x
# Fix any merge conflicts during rebase
# Diff against 8.x to create new patch
git diff 8.x > issue-[issue #]-[comment #].patch
@duellj
Copy link
Author

duellj commented Jun 21, 2013

Usually patches apply fine, given that you are checking out a branch neat the time the patch was created. But if the patch does fail, then fixing the problems should be a lot easier then if you're trying to apply it on HEAD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment