git中容易踩的坑的"–recursive"选项
在git的repo中,可能会有子项目的代码,也就是"git中的git"
–recursive是递归的意思,不仅会git clone当前项目中的代码,也会clone项目中子项目的代码。
我们有时在git clone的时候漏掉 --recursive选项,导致编译无法通过。比如:LookingGlass项目中
$ git clone --recursive https://github.com/gnif/LookingGlass.git
$ cd client/
$ mkdir build && cd build/
$ cmake ..
$ make -j 10
如果没有加 --recursive选项,那么代码库中的一些subproject或者submodule的代码将不会被git clone下来,导致缺少文件,从而引发编译错误。