Git 子模块未拉取
我有一个 git repo 作为我的主项目。它添加了一些子模块。
它看起来像:
~/super_project/ <- main git repo
~/super_project/plugins/admin <- sub-module
~/super_project/plugins/editor <- sub-module
一切都很好,它已投入并正在工作。 但是,当我将超级项目推送到 origin/master,然后将其克隆到另一台机器时,不会拉出任何子模块。
我尝试过 git submodule init 和 git submodule update 和 git submodule update --init ,它们都没有效果。
I have a git repo as my master project. It has some sub-modules added to it.
It look like:
~/super_project/ <- main git repo
~/super_project/plugins/admin <- sub-module
~/super_project/plugins/editor <- sub-module
All that's fine, its committed and working.
But when I push the super project to origin/master, and then clone it down to another machine, no sub-modules get pulled.
Ive tried git submodule init
and git submodule update
and git submodule update --init
, they all have no effect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您实际上并没有将子模块推送到主项目上。只要推他们就可以了。
如果您克隆一个应包含子模块的存储库,但根级别没有 .gitmodules ,则意味着远程服务器没有注册它们。
首先确保子模块已推送到服务器。您需要将子模块添加到父项目中(仅在另一个存储库中克隆或创建存储库是不够的)。
It seems that you didn't actually pushed your submodules on your master project. Just push them.
If you clone a repository which should contain submodules but there is no
.gitmodules
at the root level it means that the remote server do not have them registered.First ensure that the submodules are pushed to the server. You need to add the submodules to the parent project (just cloning or creating a repo inside another repo isn't enough).