How to isolate projects/folders with git that are part of a large project?

半腔热情 提交于 2019-12-08 03:59:56

问题


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

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?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/29325641/how-to-isolate-projects-folders-with-git-that-are-part-of-a-large-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!