我有一个主要的git存储库A,我们正在使用另一个git存储库B在我们的主项目的子目录中的源。 现在,在此使用的子目录中的A存储库中检出B存储库会很好。 如果其他人然后克隆存储库,当然他应该得到我们的主存储库A并且在那里自动存储B存储库。Git存储库内的Git存储库
让我想象的目录结构:
+ main_repository - the root directory of the main Repository + src - directory containing the source + foreignRepo - this should be the root directory of another git repo + binaries + other
这必须在远程存储库中也称,只是一个本地副本并不能帮助我,因为其他人检查了这一点,并且必须能够编译所有的东西。
你应该看看你的需求的Git子模块:http://book.git-scm.com/5_submodules.html – 2010-12-21 14:32:04
更新后的链接:http://schacon.github.io/gitbook/5_submodules.html – twasbrillig 2014-11-14 05:20:59
博客post解释了每种方法的优缺点[Git Submodule:Git Subtree](http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/)。 – 2016-02-16 13:34:23