git 两个版本的软件(免费和付费) [英] git for two versions of software (free and paid)

查看:50
本文介绍了git 两个版本的软件(免费和付费)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 git 或任何 VCS 是否有可能在一个存储库中维护基本相同软件的两个版本(免费"版本和付费版本)?我设想了一个主分支(可能是免费"分支)和一个付费分支,我将免费"分支合并到其中.

Is it possible with git, or any VCS, to maintain two versions of essentially the same software (a "free" version and a paid version) within one repository? I envision a master branch (maybe the "free" branch) and a paid branch in which I merge the "free" branch into.

我不精通这个领域,所以我的想法和术语可能不完全准确.我还没有尝试过,因为即使它有效,它也可能不是最好的方法.谢谢!

I am not well versed in this area so my thinking and terminology may not be entirely accurate. I haven't tried this as even if it works, it may not be the best approach. Thanks!

推荐答案

这样的业务逻辑应该在构建策略中实现.使用 git 保留两个相似的代码库是一个很大的 NO NO.

Such business logic should be implemented in build strategy. Use git to keep two similar code base is a big NO NO.

即使在像 PHP 这样的解释型语言中,您仍然需要构建.您的代码不应直接从源代码中使用.至少你需要为生产模式编译 CSS、Javascript 等.所以构建是必须的.

Even in interpreted language like PHP you still need to build. Your code should not be available for use directly from source code. At least you need to compile CSS, Javascript etc for production mode. So build is a must.

现在是免费和付费版本.不知道你们是怎么区分的.我想更好的逻辑是通过插件或模块.付费版本有更多或更好的功能,可以通过包含单独的插件或模块来完成.

Now comes your free and paid version. I don't know how you separate them. I suppose a better logic is through plugins or moduals. Paid version has more or better functions which could be done by including separate plugins or moduals.

所以现在逻辑很简单:

  1. 您保留一个公共存储库来提供免费版本.
  2. 您保留付费版本的私人存储库,其中包括 1) 高级插件/模块.2) 构建获取免费 repo 和编译付费版本的策略.

这篇关于git 两个版本的软件(免费和付费)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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