简体   繁体   English

具有多个主分支的Gitflow

[英]Gitflow with multiple master branches

While this is similar to the thread Git-flow and master with multiple parallel release-branches and to What's best way to work with git on multiple master branch? 虽然这类似于具有多个并行释放分支的线程Git-flow和master,并且类似于在多个master分支上使用git的最佳方法是什么? , it is not quite identical... I did find this one is rather similiar: Multiple projects with same GIT master , but I want discuss my specific use case... ,但并不完全相同...我确实发现这很相似: 具有相同GIT主文件的多个项目 ,但我想讨论我的特定用例...

The company I work for is in the process establishing policies and procedures for our Git work flow. 我工作的公司正在为Git工作流程建立政策和程序。 We want to use the "Gitflow" model as described in the article http://nvie.com/posts/a-successful-git-branching-model/ or https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow and is commonly referenced in many discussions on the matter. 我们要使用http://nvie.com/posts/a-successful-git-branching-model/https://www.atlassian.com/git/tutorials/comparing中所述的“ Gitflow”模型-workflows / gitflow-workflow,并且在此问题的许多讨论中都经常提及。

We have a use case, however, with a requirement for which I cannot find a solution documented. 但是,我们有一个用例,但有一个需求,我无法找到记录在案的解决方案。 What if your project is used to produce more than one final product? 如果您的项目用于生产多个最终产品怎么办? The master branch cannot therefore represent the "release points" as if it were one single product. 因此,主分支无法像代表单个产品一样代表“发布点”。 It seems that perhaps alternate branches are required from the master? 看来师父可能需要其他分支? So multiple parallel release branches? 那么有多个并行释放分支?

For instance, what if the project acts as a backbone or engine to something that can have different skins, flavours, or variations but you want to have each of the full resulting final products stored in one repository? 例如,如果项目充当具有不同外观,口味或变体的事物的主干或引擎,但您希望将所有最终最终产品都存储在一个存储库中,该怎么办?

In my particular scenario, I have a program which runs on a Linux server, but it is also distributed as a local Windows application. 在我的特定情况下,我有一个在Linux服务器上运行的程序,但它也作为本地Windows应用程序分发。 In these differing versions, there are large chunks of the project which may or may not be included in one or the other releases. 在这些不同的版本中,项目的很大一部分可能包含在一个或另一个版本中,也可能不包含。 As an example, there are libraries on the server which do not need to be included if the repo was for the server only, but which must be included for the local distribution where they would not otherwise exist. 例如,如果存储库仅用于服务器,则不需要包含服务器上的库,但必须将它们包含在本地发行版中,否则它们将不存在。 I want to pull updates to the repo onto the server at specific release points, but omit such pieces that don't belong there. 我想在特定的发行点将更新回购到服务器上,但是忽略不属于该版本的文件。

From the master branch, would I create a "Server Release" and "Local Release" branch? 我可以从master分支创建“服务器发行版”和“本地发行版”分支吗?

Where would the development branch (and it's features) then come off of? 开发分支(及其功能)将从何而来? I don't want multiple development branches, each coming from it's own release, as the code developments are in fact 99% applicable to both of those. 我不希望有多个开发分支,每个分支都来自其自己的发行版,因为代码开发实际上99%适用于这两个分支。 Do I need to merge a single dev branch into one and then the other release? 我是否需要将一个dev分支合并为一个,然后再合并为另一个版本?

If 99% of the code is shared between the two products, you could easily share the same repository. 如果两种产品之间共享99%的代码,则可以轻松共享同一存储库。 You can have a single release/develop/master branch as long as the two products are on the same release cycle eg, version 2.0 ships at the same time. 只要两个产品处于相同的发布周期,就可以拥有一个release / develop / master分支,例如,同时发布2.0版。

From the master branch, would I create a "Server Release" and "Local Release" branch? 我可以从master分支创建“服务器发行版”和“本地发行版”分支吗?

In gitflow you actually branch releases from develop! 在gitflow中,您实际上是从develop分支发布的! But in the case that they are on different release cycles, there's nothing stopping you from creating a release branch per product. 但是,如果它们处于不同的发布周期,则不会阻止您为每个产品创建发布分支。 Then you are free to merge the release branches in to the develop and master branches when they are done on their own time. 然后,您可以自由地将发行分支合并到自己的开发分支和主分支中。 The only thing here is that you will likely need to have two different flavors of tags on the master branch so that you can see where each product is on its release cycle. 唯一的问题是,您可能需要在master分支上使用两种不同的标签样式,以便可以看到每种产品在其发布周期中所处的位置。 Or to keep the tags in the same format, you may have two master branches (one per product), which you merge into respectively when a feature is completed for the respective product. 为了使标签保持相同的格式,您可能有两个主分支(每个产品一个),当相应产品的功能完成时,您会分别合并到其中。

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

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