Git:git clone 之 --recursive 选项

在git的repo中,可能会有子项目的代码,也就是"git中的git"

 --recursive是递归的意思,不仅会git clone当前项目中的代码,也会clone项目中子项目的代码。

我们有时在git clone的时候漏掉 --recursive选项,导致编译无法通过。因为如果没有加 --recursive选项,那么代码库中的一些subproject或者submodule的代码将不会被git clone下来,导致缺少文件,从而引发编译错误。

所以尤其在需要编译的时候,git clone最好加上--recursive,用于循环克隆git子项目,如:

git clone --recursive https://github.com/nvlabs/tiny-cuda-nn

猜你喜欢

转载自blog.csdn.net/DragonGirI/article/details/132739233