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

查看:79
本文介绍了两种软件版本(免费和付费)的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来保持两个相似的代码库是一个很大的问题.

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.

所以现在的逻辑很简单:

So the logic is simple now:

  1. 您保留一个公共存储库来提供免费版本.
  2. 您保留付费版本的私人仓库,其中包括1)高级插件/模型. 2)制定获取免费回购协议并编译付费版本的策略.

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

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