在使用 git clone 命令拉取包含子模块的资源时,遇到下面这种情况可能会出现空文件夹的情况,没有获取到原始内容
freetype, lv_drivers , lvgl这几个文件夹里边会是空的
git clone 含有子模块的项目
当一个 git 项目包含子模块(submodule) 时,直接使用 git clone 克隆下来的子模块目录里面是空的。
简单的方法是拉取时添加 --recursive 参数
git clone --recursive https://github.com/lvgl/lv_sim_visual_studio.git
如果不想删除已经下载的资源,可以使用另一种方法
执行下面的步骤:
1.初始化本地子模块配置文件;
git submodule init
2.更新项目,抓取子模块内容。
git submodule update
如果你不确定子模块是否都已经下载完全了,也可以进入到资源目录下
执行一遍这个命令确认
git submodule update --init --recursive
最笨的方法.根据版本号一个一个手动拉取 ,然后再复制合并
git clone -b +分支 + 地址
git clone -b 4f35711 https://github.com/freetype/freetype.git
git clone -b 4a8b681 https://github.com/lvgl/lv_drivers.git
git clone -b 01daed3 https://github.com/lvgl/lvgl.git