Git 不会克隆所有目录

mai*_*mic 1 git github

我尝试克隆antlr4dart存储库

git clone https://github.com/tiagomazzutti/antlr4dart
Run Code Online (Sandbox Code Playgroud)

但是子目录antlr4dart/antlr4dart-runtime保持为空。所有其他文件都按照我的预期进行克隆。我做错了什么?

谢谢,迈克尔

Von*_*onC 5

您需要添加(在 之后git clone):

cd antlr4dart
git submodule update --init
Run Code Online (Sandbox Code Playgroud)

antlr4dart-runtimeGitHub 存储库中的灰色“ ”文件夹是一个子模块,其中的gitlink 条目指的是该子模块存储库SHA1 1f4b2b6


小智 5

克隆后,你必须跳转到目录:

cd antlr4dart
Run Code Online (Sandbox Code Playgroud)

要克隆目录的所有子模块,请执行以下操作:

git submodule update --init
Run Code Online (Sandbox Code Playgroud)

在 Git 1.6.5 及更高版本中,您可以使用:

git clone --recursive git://github.com/foo/bar.git
Run Code Online (Sandbox Code Playgroud)