Backport = take a commit from main and apply it to a release branch.
git switch release/1.0
git cherry-pick <hash-from-main>
If the file structure has diverged, expect conflicts. Resolve, then git cherry-pick --continue.
Conventions:
- Add a marker to the message:
(cherry picked from commit abc123) (cherry-pick -x does this automatically).
- Some teams require backports to go through a PR for review even if the original was approved.
- Use a unique label on GitHub (
backport-1.0) to track.
Automation: backport-bot (Mergify, Backport CLI) can auto-cherry-pick when you label a PR.
When backports diverge too much, write a new commit on the release branch instead and reference the original — don't try to force a dirty cherry-pick.