Managing hotfixes when develop branch is very different from master?

前端 未结 4 891
春和景丽
春和景丽 2020-12-07 10:19

I\'m using the \"Git Flow\" branching model, with a master branch and a develop branch. I\'m working on a major new release, so my develop branch is wildly different from my

4条回答
  •  盖世英雄少女心
    2020-12-07 10:54

    My general workflow for this situation is to create a bug-fix branch of master that fixes the problem. Once it's ready, merge that back into master then merge master into develop.

    This assumes that your bug fix is almost a one-to-one between the code it needs to change in both branches. If that's the case, you could always try a git merge -s ours master (see man-page) into develop so the develop branch takes priority.

    I use a similar process for managing bug fix releases on an open-source project I'm working on. master is always ahead of where the bug fix needs to be applied, so I create a branch from the tag that needs the fix, apply the fix and release, then retag and merge the new tag into master. This causes a conflict because of the version numbers, but can be avoided with the command above.

    Hope that helps.

提交回复
热议问题