如何 `git clone` 不包括子模块?

How to `git clone` NOT-including submodules?

场景:

我需要处理一个 repo,它有一个我不需要的子模块(事实上,如果我想使用像 SourceTree 这样的 GUI,因为访问限制等,它会导致错误警告和问题)。

问题:

有没有办法在克隆远程仓库时忽略子模块?

奖金:

我真的很想知道 SourceTree 是否可行?

谢谢!

git clone 本身不会拉取子模块。您需要调用 git submodule update --init 来执行此操作...或使用 this answer.

中的变体之一

要不在 SourceTree 中克隆子模块,请在 Clone 对话框中打开 Advanced Options 并确保未选中 Recurse Submodules