如何保持/维护公共和私人代码在同一个存储库中? (在存储库托管) [英] How to keep/maintain public and private code in the same repository? (at repository hostings)

查看:152
本文介绍了如何保持/维护公共和私人代码在同一个存储库中? (在存储库托管)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理我自己的项目,这个项目有两部分:

A。内核/通用代码(公共部分)

B。代码与私有协议等一起工作(私人部分,可用于我和一些授权人员)

我想存储库托管(也许github,assembla,...)允许在同一个仓库中的公共和私人分支机构工作。



我不需要两个存储库,因为我正在积极地处理这两个部分,并且希望避免存在分歧的存储库。

哪些解决方案适用于我?

解决方案


它允许在公共和私人分支在同一个存储库中工作。


这似乎与Git作品:如果您有权访问回购站点,则可以克隆其所有内容(包括分支机构)。



Git Hosting服务(如< a href =https://bitbucket.org =nofollow noreferrer> BitBucket 或 GitLab 可以保护胸罩nch(意思是你不能推回去)。但你仍然可以看到它的内容。

即使 Gitolite 不会阻止在分支级别读取访问权限

因此,两个单独的回购仍然是最好的方法,将repo A(kernel)声明为 子模块 的回购乙。


I'm working on my own project which has two parts:

A. kernel/generic code (public part)

B. code which works with proprietary protocol etc (private part, available for me and a few authorized persons)

I want repository hosting (maybe github, assembla, ...) which allows working in public and private branches in the same repository.

I don't want two repositories because I'm actively working on both parts and I want to avoid diverged repositories.

Which solution is available for me?

解决方案

which allows working in public and private branches in the same repository.

That doesn't seem compatible with how Git works: if you have access to a repo, you can clone all its content (including the branches).

A Git Hosting service like BitBucket or GitLab allows you to protect a branch (meaning you cannot push back). But you would still be able to see its content.
Even Gitolite doesn't prevent read-access at a branch level.

So two separate repos are still the best approach, with the repo A (kernel) declared as a submodule of repo B.

这篇关于如何保持/维护公共和私人代码在同一个存储库中? (在存储库托管)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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