我可以通过创建存储库 https://github.com/ (说 repo
)并且:
https://github.com/username/repo.git
如何创建另一个存储库(比如说 sub_repo
放在 repo
并且预计会有:
https://github.com/username/repo/sub_repo.git
我可以通过创建存储库 https://github.com/ (说 repo
)并且:
https://github.com/username/repo.git
如何创建另一个存储库(比如说 sub_repo
放在 repo
并且预计会有:
https://github.com/username/repo/sub_repo.git
GitHub不允许嵌套存储库(IIRC Git不允许使用裸存储库)。
但是,您可以使用子模块在工作树中的“客户端”上嵌套存储库。
您需要克隆父目录。
然后,将子存储库添加为 子模块:
git submodule add https://github.com/username/sub_repo.git
然后,sub_repo模块将链接到父repo,并且可以在sub_repo目录中找到。
提交(.gitmodules和sub_repo),推送,你就完成了。
GitHub不允许嵌套存储库(IIRC Git不允许使用裸存储库)。
但是,您可以使用子模块在工作树中的“客户端”上嵌套存储库。
您需要克隆父目录。
然后,将子存储库添加为 子模块:
git submodule add https://github.com/username/sub_repo.git
然后,sub_repo模块将链接到父repo,并且可以在sub_repo目录中找到。
提交(.gitmodules和sub_repo),推送,你就完成了。
github不支持嵌套存储库。如果您不想拥有子模块的绝对URL,则自定义是将它们放在超级存储库旁边并在URL中使用“../”,如下所示: https://github.com/losalamos/cinch-nested-example/blob/d59c26a89153148ba29d68dd5ee455a88efbc9a2/.gitmodules
这个 应用 也可以帮助管理子仓库作为Git子模块替代品