How to move bugfixes across branches in DVCS?

后端 未结 3 960
名媛妹妹
名媛妹妹 2020-12-06 18:16

If we discover bug in some branche we fix it (check New release on picture). But also we interesting in moving this fix to Old release and Main de

3条回答
  •  粉色の甜心
    2020-12-06 18:53

    You could:

    1. Find common parent. Thanks to Novelocrat for this step.
      git merge-base branch1 branch2 branch3 ...

    2. Checkout the common parent
      git checkout A

    3. create new branch to fix bugs on
      git checkout -b bugFix

    4. Make bug fixes and commit them to bugFix branch

    5. Checkout branch that needs the bug fix
      git checkout branchToApplyFixTo

    6. Merge the bugFix into the branch
      git merge bugFix

提交回复
热议问题