在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下來,導致缺少文件,從而引發編譯錯誤。