简体   繁体   English

Git - 上游+功能分支+发布分支

[英]Git - upstream + feature branches + release branches

I was using the rebasing topic branches workflow http://www.golden-gryphon.com/software/misc/packaging.html 我正在使用rebasing主题分支工作流程http://www.golden-gryphon.com/software/misc/packaging.html

But because the local testers and admins don't like throwaway release branches, I need to move to a worklow with stable branches. 但是因为本地测试人员和管理员不喜欢一次性发布分支,所以我需要转移到具有稳定分支的工作流。

The only one that is acceptable is merging workflow. 唯一可接受的是合并工作流程。 Now the issue is that I don't know how to work with dependent feature branches in this workflow. 现在的问题是我不知道如何使用此工作流中的相关功能分支。 When rebasing, this was simple, with each patch I simply rebased all the feature branches that depended on this branch and everything was back to normal. 在变基础时,这很简单,每个补丁我只是重新设置依赖于这个分支的所有功能分支,一切都恢复正常。 With the merging workflow I can't rebase my feature branches, but merging seems a bit crazy for this. 通过合并工作流程,我无法修改我的功能分支,但合并似乎有点疯狂。

Is there some better approach? 有更好的方法吗?

With several long-term features, the model might look like this: 有几个长期功能,模型可能如下所示:

     o-----o  bugfix
    /       \
o--o--o------o------o  develop branch
       \      \      \
        o-o----o---o--o  long-term feature 1
           \    \   \  \
            o--o-o-o-o--o--o feature 2

Basically, you have a development branch, and merge bugfixes to you development branch. 基本上,您有一个开发分支,并将错误修正合并到您的开发分支。 Long-term feature branch is base of development branch, and you update it by merging new changes from that development branch. 长期功能分支是开发分支的基础,您可以通过合并该开发分支的新更改来更新它。

Similarly, you have a feature branch for reature 2, base on feature 1, and you update it by merging new stuff new feature 1 branch. 同样,您有一个基于功能1的reature 2的功能分支,您可以通过合并新功能新功能1分支来更新它。

When feature 1 is done, you merge it back to develop, and update feature 2 from develop branch: 完成功能1后,将其合并回来进行开发,并从develop分支更新功能2:

     o-----o  bugfix
    /       \
o--o--o------o------o---o---o  develop branch w/ feature 1
       \      \      \ /     \
        o-o----o---o--o       \
           \    \   \  \       \
            o--o-o-o-o--o--o--o-o feature 2

The main difference between a merge and a rebase workflow is that merges are invisible in the rebase workflow, but they still happen (you can see them in the reflog after the rebase). 合并和rebase工作流之间的主要区别在于,合并在rebase工作流中是不可见的,但它们仍然会发生(您可以在rebase之后的reflog中看到它们)。 There are even much more of then using rebase, since for every new changeset of the to be rebased branch a merge of its own is performed, while in the plain merge workflow only one merge between the two branch heads are done. 然后使用rebase甚至更多,因为对于要重新分支的分支的每个新变更集都执行它自己的合并,而在简单合并工作流中,仅完成两个分支头之间的一个合并。

A typical merge workflow looks like this: 典型的合并工作流程如下所示:

             o-o-o--------------o         Release1+bugfixes
            /     \              \
o-----o----o--o-o--o---o----o-o-o-o-o--o  develop
       \     /               \     /
        o-o-o Feature 1       o---o Feature 2

Short-term features are developed in develop, long-term features get their own branches. 短期功能是在开发中发展起来的,长期功能得到了自己的分支。 Feature branches gets merged back into develop. 功能分支合并回到开发中。 For every release a branch is created from develop, and bugfixes are created on the release branch where the bug appeared. 对于每个版本,都会从develop创建一个分支,并在发布错误的发布分支上创建错误修正。 When a bugfix is done, it is merged back into develop. 当一个错误修复完成后,它将合并回到develop。

A better explanation can be found at http://nvie.com/posts/a-successful-git-branching-model/ . 可以在http://nvie.com/posts/a-successful-git-branching-model/找到更好的解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM