Git merging hotfix to multiple branches

后端 未结 4 1012
-上瘾入骨i
-上瘾入骨i 2021-02-01 16:48

I\'ve been trying to wrap my head around git branching models. I\'ve been looking at http://nvie.com/posts/a-successful-git-branching-model/ for some ideas and coming from Subv

4条回答
  •  心在旅途
    2021-02-01 17:28

    Really, your answer is dependant on if you want your trees to be based on the same history... For example, 4.0 is based on the latest 3.X + all of the changes in 4.0...

    Personally, I don't recommend it once you decide to start a new branch(s) for a new version(s). At a give point of time, the software is taking a different direction, so your branches should also.

    This leaves git cherry-pick as your ideal solution. Make the change in whatever branch makes the most sense, and then cherry pick it to the older versions. This is the same as if you had checked out the old branch and manually applied the same change, and made a new commit. It keeps it clean and to the point.

    Git merge or rebase are going to try to integrate the branches history together, each in their own way, which I suspect you don't want when backporting bug fixes, etc...

提交回复
热议问题