Cloning a git repo with all submodules

隐身守侯 提交于 2019-12-02 19:18:37

You can clone the git repo with all submodule using recursive as follow:

git clone --recursive your-repo-url

on the other hand if you have already cloned, you can use:

git submodule init
git submodule update

You won't lose any history in your submodule

VonC

in the cloned repository the submodule directory is empty.

If, by "cloned repo", you are referring to the bare repo, it is normal: a bare repo is always empty.

If you are alluding to a clone of the bare repo, you need to add:

git submodule update --init --recursive

That way, you will see the content of those submodules.


Remember, a submodule is:

So all you need to do is clone that repo (even with a --recursive option), and the submodules will follow.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!