Git子模块到子文件夹 [英] Git Submodule to a subfolder
问题描述
Git不支持部分签出,所以 submodule 必须指向一个完整的存储库。
Git邮件列表中的这个线程提供了一些背景信息。
来自Panther Software的这篇文章提供了其他人试图实现类似目标的一些见解(例如,使用Git复制 svn:externals
)。
如果两个项目都在您的控制之下,那么我建议您将您感兴趣的子文件夹分离为其独立的回购。然后这两个项目都可以创建链接到它的子模块。
In svn you can link a repository to any folder in another svn repository. I'm wondering if there is a similar feature for git? Basically I want a git submodule inside my repository, but I want the submodule to be a pointer to a subfolder of another git repository, not the whole repository. Is this possible?
Git does not support partial checkouts, so the submodule must point to a complete repository.
This thread on the Git mail list provides some background information.
This article from Panther Software offers some insight from someone else trying to accomplish a similar goal (i.e. replicate svn:externals
using Git).
If both projects are under your control, then I suggest you isolate the "subfolder" that you interested in to its own standalone repo. Then both projects can create submodules that link to it.
这篇关于Git子模块到子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!