我无法克隆带有子模块的父项目。仅克隆父项目。
我尝试与
- git clone --递归子模块
- git clone --recursive <repo
有这么多选择。
我需要配置我的Git环境来支持子模块吗?
这是我尝试过的仓库。
父项目
https://github.com/chamlyidunil/test-submodule-project
公共项目(子模块)
https://github.com/chamlyidunil/common-utility
如果你能提供整个周期的示例Git命令,这真的会对你有帮助。
- git pull(获取子模块的更新)
我的Git版本是2.15.1(Apple Git-101)。
1条答案
按热度按时间cuxqih211#
您的项目有一个
.gitmodules
文件,但它没有签入实际的子模块提交。如果你想添加一个子模块,你应该使用
git submodule add
来添加子模块,然后提交结果。这将把子模块提交添加到存储库中,这是您的存储库目前所缺少的。因此,例如,在父项目的个人克隆中,您将删除当前的
.gitmodules
文件并运行git submodule add https://github.com/chamlyidunil/common-utility.git common-utility
,然后提交结果。