用Git维护项目 [英] Maintaining Project with Git

查看:69
本文介绍了用Git维护项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个项目,实际上这2个项目彼此之间约有80%的差异,主要区别在于语言和商业模式,一个是针对使用英语的较大受众群体,并且每月有9美元的商业模式,另一种是将本地语言与免费增值业务模式结合使用.

I have 2 project, and actually these 2 project is about 80% same each other, the mainly difference is just about language and business model, one is for larger audience using english language and have a 9$/month business model, another is using local language with freemium business model.

有时候我想添加新功能/特性时,我想在两个项目中都添加它,但有时我也想添加功能,尤其是仅针对本地项目.

Sometime when I want to add new feature/functionality, I want to add it in both of the project, but also sometime I want to add feature especially just for the local project.

我的问题是,如何使用git维护这两个项目?

My question is, how do I maintain these 2 project with git ?

  1. 为每个项目维护2个git存储库,或者
  2. 维护带有2个主要分支的单个git存储库或
  3. 还有其他建议吗?

推荐答案

创建三个 git项目:

  • 一个核心"项目:它包含 其他两个之间共享的代码 项目

  • one "core" project: it contains the code shared between the other two projects

您的英语项目:它有一个 核心子模块以及特定子模块 代码

your english project: it has a submodule for the core plus specific code

通过这种方式,您可以更改核心项目,更新子模块引用并且会很好

this way you can change your core project, update the submodule references and you'd be good

这篇关于用Git维护项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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