git with development, staging and production branches

后端 未结 4 514
野的像风
野的像风 2020-12-22 18:15

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:32

    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.

提交回复
热议问题