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

前端 未结 2 1315
南方客
南方客 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: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.)

提交回复
热议问题