Skip to content

How to back port a fix from master to the stable branch

Brad Baker edited this page Aug 30, 2018 · 3 revisions

Contributions from the wider world often target "master" even though they would be great fixes on stable.

Its too onerous to ask them to rebase of the stable N.x branch and hence we should merge it to master and the cherry pick it back to a stable branch.

  • Make sure your up to date
    • git fetch upstream
  • Check out the stable branch
    • git checkout N.x
  • Make a new branch with the standardized naming
    • git checkout -b stable_fix_of_pr_NNNN
  • Get the changes you want to back port
    • git cherry-pick nnnnnnnnn
  • Double check the change is the correct one and build locally
  • Push these back
    • git push
  • make the PR on GitHub and target the stable branch N.x (not master)
  • name the PR "stable fix of PR NNNN"
  • label it as "stable fix"