为多个客户管理多个git发布分支 [英] Manage multiple git release branches for multiple customers

查看:265
本文介绍了为多个客户管理多个git发布分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司有一款软件,我们向多个客户销售。
但是每个客户都有不同的要求(不仅仅是把我们的标志放在这里)。核心对于所有这些都是一样的,但有些不需要某些模块,有些则需要它们,包括修改。



我想要管理所有这些单一的git仓库,所以我有他们所有的相同的核心,但我不太清楚如何做到这一点最好的方式。



我读了 Git Flow ,以及如何制作单个项目成功的分支机构,它给出了这样的分支模型:

http://nvie.com/img/git-model@2x.png



现在,我们有多个客户,因此有多个版本分支机构( release-customer1-v1.2 release-customer2-v3.8 ,...),但它们都基于相同的 master 分支。



有没有策略可以使用管理这种混乱?

解决方案

感谢@AnimiVulpis。他/她的回答给了我一个提示。
这是我的解决方案:(也是基于nvie的策略)

1.从项目中提取确切的公共部分。创建一个名为shared / develop的分支

基于shared / develop创建一个customer1的分支

  git checkout -b local / customer1 / develop origin / shared / develop 
#将这个新分支推送到远程
git push origin local / customer1 / develop:origin / customer1 / develop
git push origin local / customer1 / develop:origin / customer1 / master

3与第2步一起创建其他客户的分支。

4.所有客户使用的所有通用部分都应该在共享/开发分支上工作。



4.所有针对客户N的功能开发应该在其自己的客户/开发分支上工作。应该注意,所有客户的分支应该在共享/开发分支之前合并功能
编码。


My company has a piece of software we sell to multiple customers. But every customer have some different requirements (more than just "Put our logo here"). The core is the same for all of them, but some does not need certain modules, others need them all including modifications.

I would like to manage all of this in a single git repository so I have the same core for them all, but I'm not quite sure how to do this the best way.

I read about Git Flow, and how to make a single project succesful regarding branches, which gives a branch model like this:

http://nvie.com/img/git-model@2x.png

Now, we have multiple customers, and therefore multiple release branches (release-customer1-v1.2, release-customer2-v3.8, ...), but they all build on the same master branch.

Are there any strategy to manage this chaos?

解决方案

Thanks for @AnimiVulpis. His/Her answer gave me a hint. Here's my solution: (also base on the nvie's strategy)

1.Extract the exact common parts from project. Create a branch named shared/develop

2.Based on the shared/develop, creating a customer1's branch

git checkout -b local/customer1/develop origin/shared/develop
#push this new branch to remote
git push origin local/customer1/develop:origin/customer1/develop
git push origin local/customer1/develop:origin/customer1/master

3.Same with step 2. create other customers' branch.

4.All the common parts used for all customers should work on shared/develop branch.

4.All the feature development just for the customerN should work on its own customerN/develop branch.It should be note that all the customers' branches should merge from shared/develop branch before a new feature coding.

这篇关于为多个客户管理多个git发布分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆