如何使用git隔离属于大型项目的项目/文件夹? [英] How to isolate projects/folders with git that are part of a large project?

查看:184
本文介绍了如何使用git隔离属于大型项目的项目/文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Bitbucket上托管的git是否有可能在git repo中拥有一个目录,使其成为拥有自己访问权限的子仓库?

Is it possible with git hosted on Bitbucket to have a directory inside a git repo to be a subrepo with own access rights?

在这种情况下,我目前正在使用Subversion,并希望切换到GitHub.

I am currently working with subversion where this is the case and want to switch to GitHub.

我如何才能在庞大的代码库中隔离小型项目,以便与仅查看和处理驻留在该项目目录中的特定代码的自由职业者一起工作?

How can I isolate small projects within a huge codebase in order to work with freelancers that only see and work on that particular code which lives in a directory of that project?

推荐答案

最好使用子模块:您的主项目将具有引用"(称为 索引中的特殊条目)其他存储库.

It is best to work with submodules: your main project will have "references" (called gitlink, special entries in the index) to your other repos.

这些回购协议将在您的主项目中声明为子模块,但可以由其他开发人员独立使用.

Those repos will be declared in your main project as submodules, but can be used independently by other developers.

使用 git submodule add ,您可以引用位于任何Git存储库中的存储库您想要的托管服务:BitBucket主存储库可以引用由GitHub管理的存储库.
这意味着您的主项目可以在BitBucket上为 private ,而依赖项(子模块)在GitHub上为 public 仓库.

Using git submodule add, you can reference a repo located in any Git repo hosting service you want: a BitBucket main repo can reference repos managed by GitHub.
That means that you main project can be private on BitBucket, while the dependencies (the submodules) are public repos on GitHub.

这篇关于如何使用git隔离属于大型项目的项目/文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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