[英]Git workflow for different versions of a framework
We have the following setup: Three apps which are similar to each other with the common code extracted into a framework. 我们有以下设置:三个相似的应用程序,将公共代码提取到框架中。 Each app is managed in their own git repository and includes the framework as a git submodule.
每个应用程序都在自己的git存储库中进行管理,并将框架作为git子模块包含在内。
The problem is that the apps are now developed in parallel with new features being added to the framework that other apps don't need to support right away. 问题是,现在应用程序与并行开发的新功能被添加到框架中,其他应用程序不需要立即支持。 Currently we have different branches of the framework for all apps.
目前,我们为所有应用程序提供了不同的框架分支。 One app uses the master branch of the framework because most of the time new features were first introduced in this app.
一个应用程序使用框架的主分支,因为大多数时候新功能首次在此应用程序中引入。
Framework branches 框架分支
When a new feature is introduced in appB that needed changes in the framework these changes were made to branch appB. 当appB中引入了一个需要在框架中进行更改的新功能时,会对分支appB进行更改。 If these changes were later needed in App A, branch appB was merged into master.
如果以后需要在App A中进行这些更改,则将分支appB合并为master。 This means that all changes in appB had to be merged into master.
这意味着appB中的所有更改都必须合并到master中。
This system worked but had some flaws 这个系统有效,但有一些缺陷
We are currently searching for a new workflow. 我们目前正在寻找新的工作流程。 I was think about having the following branches
我考虑过拥有以下分支机构
So for each app one branch and a master branch that includes all the changes. 因此,对于每个应用程序,一个分支和一个包含所有更改的主分支。 When new features are developed a feature branch should be created and then applied to master as well as to all app branches the feature is needed right away.
在开发新功能时,应创建功能分支,然后将其应用于主分支以及所有应用分支,立即需要该功能。 Other apps can merge the feature branch when they need the feature later on.
其他应用程序可以在以后需要该功能时合并功能分支。
I see the following problems with this 我看到了以下问题
Is my purposed way the best way to accomplish this or should I rethink my strategy completely? 我的目的是实现这一目标的最佳方式,还是我应该完全重新考虑我的策略?
As explain in " Git & Working on multiple branches ", the two practical solutions when applying commits to multiple branches (which is what you would do with your "feature branches" option) are: 正如“ Git&Working on multiple branches ”中的解释,将提交应用于多个分支时的两个实用解决方案(这是您使用“功能分支”选项所做的)是:
rebase --interactive
might be in order for you to re-order the commits, putting first the ones you want to merge, and then the ones you are nnot ready yet to merge. rebase --interactive
可能是为了您重新排序提交,首先放置你要合并的那些,然后你尚未准备合并的那些。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.