.gitmodules中的Git子模块未初始化 [英] Git submodules in .gitmodules not initialized

查看:367
本文介绍了.gitmodules中的Git子模块未初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://github.com/Uni-/shBrushesCollection



我打开了一个GitHub仓库,并在GitHub网站源代码编辑器中编写了.gitmodules。当我克隆了rpo时,我发现.gitmodules中的子模块没有被初始化。



我想我尝试了几乎所有可能的命令,包括update,init,update - init等等。有没有办法使用当前的.gitmodules文件,而不是子模块添加? 解决方案



您应该使用 git submodule add :它会更新你的 .gitmodules 文件创建一个在索引中的特殊条目(您希望加载该子模块的位置)。



然后,当您将其推送到GitHub上的上游回购站时,项目页面会将这些特殊条目显示为绿色文件夹




https://github.com/Uni-/shBrushesCollection

I opened a GitHub repo and wrote .gitmodules in GitHub web source editor. When I cloned the rpo, I found the submodules in .gitmodules are not being initialized.

I think I tried almost all commands possible, including update, init, update --init and so on. Is there a way to use current .gitmodules file, not submodules add?

解决方案

Writing a submodule isn't enough.

You should rather use git submodule add: that will update your .gitmodules file and create a special entry in the index (where you want that submodule to be loaded).

Then, when you push that to your upstream repo on GitHub, the project page will display those special entries as a green folder.

这篇关于.gitmodules中的Git子模块未初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆