克隆一个带子模块的项目

步骤

git clone 仓库地址 克隆该项目

克隆下来后只会发现子模块并没有一起克隆下来,需要将子模块也克隆下来。

git submodule init 初始化你的本地配置文件

git submodule update 从那个项目拉取所有数据并检出你上层项目里所列的合适的提交

报错处理

1、如果如下错误:

Please make sure you have the correct access rights

fatal: Could not read from remote repository.

是因为没有子模块的操作权限导致的,添加权限

2、git submodule update 报如下错误:

$ git submodule update --init 
fatal: Needed a single revision 
Unable to find current revision in submodule path ’xxx子模块库名xxx’

解决:

rm -rf xxx子模块库名xxx

git submodule update --init

猜你喜欢

转载自blog.csdn.net/Morris_/article/details/81701411
今日推荐