How can I easily apply a bugfix on several release branches in Git?

前端 未结 2 1298
南方客
南方客 2021-02-14 11:30

I\'ve been using git for a while for my one-man developments, but I haven\'t run into any tricky branching issues until now and I seem to have forgotten something fundamental th

相关标签:
2条回答
  • 2021-02-14 12:03

    What about in this case fixing on B1.1, merging B1.1 into B1.2, then B1.2 into B1.3?

    0 讨论(0)
  • 2021-02-14 12:19

    The right way in this case would be to:

    • make sure you have B1.1 and B1.2 created (to isolate final fixes in their respective branch)
    • apply your patch on master
    • cherry-pick that commit to B1 and B2

    As mentionned in this thread, that would:

    ensures master doesn't regress with respect to an older branch. (Do not use merge unless you want to merge all changes from one branch to another, rather than just the single commit you mention.)

    0 讨论(0)
提交回复
热议问题