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.

Tags

Help improve this page

Page status: No known problems

You can: