WordPress/gutenberg
View on GitHubImprove the manual `git cherry-pick` instructions left when performing an automatic cherry-pick fails
Open
#76576 opened on Mar 17, 2026
Good First Issue[Status] In Progress[Type] Build Tooling[Type] Enhancement
Description
What problem does this address?
When the Auto Cherry-Pick GitHub Actions workflow fails, the following comment is left on the PR:
# Checkout the wp/7.0 branch instead of trunk.
git checkout wp/7.0
# Create a new branch for your PR.
git checkout -b my-branch
# Cherry-pick the commit.
git cherry-pick d738de8b5ccd5cfc0dceee7e7c232738ebade15c
# Check which files have conflicts.
git status
# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue
# Push the branch to the repository
git push origin my-branch
# Create a PR and set the base to the wp/7.0 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.
These are great but there are a few things that can be improved.
What is your proposed solution?
- Instead of
my-branch, the instructions should include a contextual branch name. Above, a cherry-pick ofd738de8b5ccd5cfc0dceee7e7c232738ebade15cis being attempted. The branch could should be some combination of commit SHA value, PR number, and target branch. Some possible values:wp/7.0/cherry-pick/d738de8b5ccd5cfc0dceee7e7c232738ebade15c-from-76398cherry-pick/d738de8-to-wp-7.0-from-76398(shortened hash)cherry-pick/76398-to-wp-7.0- etc.
- It should be noted that the conflict resolution step is optional/only if necessary.
- It's not clear if someone should perform this on their fork or the main repository. I think either is probably fine, but noting that could help someone without
writeaccess to this repo know they are free to create a PR performing thecherry-pickif they would like to. - The link included in the last step (Create a PR and set the base to the wp/X.Y branch) is helpful, but the link is not clickable. That last step should be removed from the code block and placed after.
- Setting the correct
BASEbranch of a PR is easy to forget. I think it could be helpful to include the command to accomplish that using GitHub CLI:gh pr create --base wp/7.0 --web. This will open the web UI with the correctHEADandBASEbranches set so the person can enter the details for the pull request. Alternatively,gh pr create --title="Cherry-pickd738de8towp/7.0" --body="Auto-generated description here"(I don't believe that--webcan be combined with--titleand--body).