回购克隆后,空的Git子模块文件夹 [英] Empty Git submodule folder when repo cloned
问题描述
我在 https://github.com/aikiframework/json 上托管了一个仓库.在我的本地副本上,我使用命令添加了一个子模块
I have one repo hosted at https://github.com/aikiframework/json . On my local copy, I added a submodule using the command
git submodule add git@github.com:jcubic/json-rpc.git json-rpc
然后我进行了提交和推送,所做的更改显示在GitHub上(我可以单击它).但是当我克隆仓库时
Then I did a commit and push, and the changes appear on GitHub (I can click on it). But when I clone the repo
git clone https://github.com/aikiframework/json.git
子模块文件夹json-rpc为空.
the submodule folder json-rpc is empty.
我在这里想念什么?我忘了什么吗?为什么该文件夹为空?
What am I missing here? Did I forget about something? Why is that folder empty?
推荐答案
好,我找到了它,克隆仓库时需要添加-recursive
.
OK I found it, needed to add --recursive
when cloning the repo.
因此clone命令最终显示为:
So the clone command ends up as:
git clone https://github.com/aikiframework/json.git --recursive
请注意,如果您忘记了-recursive
标志,则可以执行以下操作:
Note that if you forgot the --recursive
flag you can do:
git submodule update --init
这篇关于回购克隆后,空的Git子模块文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!