简体   繁体   English

Git中的专有+开源设置? (例如铬/铬)

[英]Proprietary + Open Source setup in Git? (eg. chrome/chromium)

How would you setup an code repository where you have a proprietary version and an open source version, say like Chrome and Chromium? 您将如何设置代码存储库,其中包含专有版本和开源版本,例如Chrome和Chromium?

With Git, would you use two branches or two repositories? 使用Git,您会使用两个分支还是两个存储库?

How would you keep the "private" version up to date with the open source one? 你如何保持“私人”版本与开源版本保持同步?

If it were me, I would have two repositories. 如果是我,我会有两个存储库。 This way, you can have different permissions on each - public read access for the open source version and read/write for developers only on the "private" one. 这样,您可以对每个开放源代码具有不同的权限 - 开源版本的公共读取访问权限以及仅针对“私有”版本的开发人员的读/写权限。

To keep the private version up to date, I would set up a remote on the private version repository which points to the public version repository. 为了使私有版本保持最新,我将在专用版本存储库上设置一个指向公共版本存储库的远程版本。 This would allow you to pull or rebase changes from there onto the private one. 这将允许您将更改从那里拉或更改为私有更改。 This does however make the assumption that changes will not conflict (ie the private version feature-set is a super-set of the public version, rather than a divergence). 然而,这确实假设变化不会发生冲突(即私有版本特征集是公共版本的超集,而不是分歧)。

I would suggest two different repositories rather than branches. 我会建议两个不同的存储库而不是分支。 git pull and/or push will help you move changes from open source repo to proprietary repo. git pull和/或push将帮助您将更改从开源repo移动到专有repo。

使用您的2个存储库作为git子模块,以及其他元存储库来跟踪私有和开源存储库的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM