我正试图用几个git子模块克隆存储库的一个特定分支,但却没有成功地克隆它们。我在努力:
git clone --recurse-submodules --branch myBranch -j8 https://github.com/me/myrepo
但是,即使在克隆开始之后,所有子模块文件夹都是空的。
也在尝试 git submodule update , git submodule sync ……但没什么用,我也没主意了。
git submodule update
git submodule sync
确保MyBranch中有这些子模块:
.gitmodules
git ls-files -s aSubmoduleFolder
如果没有子模块条目,这将解释为什么它们是空的。 如评论所述,如果它们是 git submodule update --init 应该够了。
git submodule update --init