Command-only full patch workflow
Last updated on
1 December 2022
This page gives just the commands to apply a patch, make a new patch with additional changes, and reroll a patch. For more details on each set of commands, see the related content links below.
Apply an existing patch to a new feature branch
git checkout 8.0.x
git pull
git checkout -b ISSUENAME-NUMBER
curl http://drupal.org/files/ISSUENAME-NUMBER-COMMENTNUMBER.patch | git apply
git add FILESAFFECTED
git commit -m “Patch COMMENTNUMBER by OTHERPERSON”
Make a new patch after editing files
git diff > ~/path/to/patches/interdiff-ISSUENUMBER-COMMENTNUMBER-NEWCOMMENTNUMBER.txt
git commit -m “Patch NEWCOMMENTNUMBER by ME”
git diff origin/8.0.x > ~/patchespath/dreditorsuggestedpatchname
Reroll a patch
git fetch origin
git merge origin/8.0.x
Resolve conflicts in the reroll, if any:
git commit -m “Patch NEWCOMMENTNUMBER by ME”
git diff origin/8.0.x > ~/patchespath/dreditorsuggestedpatchname
If the patch that you initially downloaded from the issue no longer will apply, ie. needs reroll, you can find the commit that the patch did apply to by viewing the testbot log. You can then rewind your branch back to that commit, apply the patch, then fast-forward merge your branch back to Head.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.