git with development, staging and production branches

后端 未结 4 918
旧时难觅i
旧时难觅i 2020-12-22 17:58

This article sounds interesting, but I\'m pretty sure the diagrams are wrong. http://guides.beanstalkapp.com/version-control/branching-best-practices.html

Shouldn\'t

4条回答
  •  天涯浪人
    2020-12-22 18:55

    We do it differently. IMHO we do it in an easier way: in master we are working on the next major version.

    Each larger feature gets its own branch (derived from master) and will be rebased (+ force pushed) on top of master regularly by the developer. Rebasing only works fine if a single developer works on this feature. If the feature is finished, it will be freshly rebased onto master and then the master fast-forwarded to the latest feature commit.

    To avoid the rebasing/forced push one also can merge master changes regularly to the feature branch and if it's finished merge the feature branch into master (normal merge or squash merge). But IMHO this makes the feature branch less clear and makes it much more difficult to reorder/cleanup the commits.

    If a new release is coming, we create a side-branch out of master, e.g. release-5 where only bugs get fixed.

提交回复
热议问题