在多个master分支上使用git的最佳方式是什么? [英] What's best way to work with git on multiple master branch?

查看:189
本文介绍了在多个master分支上使用git的最佳方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作项目有一个git repo。
该软件仍在开发中,但我现在有三个不同的分支主,每个分支都有一些小的变化(图形定制和不同的行为)。
我无法自动将我的开发分支与这些主分支合并,因为每个分支都是不同的。
我读过关于git cherry-pick的问题,但我的问题是:这是正确的工作方式吗?
我真的需要这个三个不同版本的我的项目,也许我可以尝试将核心与定制分开,并与git submoduele一起使用?

thanks

解决方案

如果可以将这些变体隔离在自己的子目录中,那么可以使用子模块(因为子模块将如何构造在您的父库中:例如,请参阅为git迁移规划存储库布局)。

应该是图形变化的情况。



如果这些变体是简单的配置文件差异,您也可以使用一个分支和内容过滤驱动,以便生成正确的配置文件,基于回购签出的环境。



我更喜欢那些选择樱桃采摘,可以引入:


I have a git repo for my work project. The software is still under development but i have now three different branch "master" each with some little variations (graphical customization and different behaviour). I cannot merge automatically my development branch with these master branch, because every branch is differnet. I read about git cherry-pick but my question is: "is this the right way to work?" I really need this three different version of my project, maybe can i try to separate the "core" with the "customization" and works with git submoduele?

thanks

解决方案

You could use submodules if those variations can be isolated in their own subdirectory (since it is how submodules will be structured within your parent repository: see for instance "Planning repository layout for git migration").
That should be the case for the graphical variations.

If those variations are simple config files differences, you can also use one branch and content filter driver in order to generate the right config file, based on the environment in which the repo is checked out.

I prefer those options to cherry-picking, which can introduces:

这篇关于在多个master分支上使用git的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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