git 项目过大,无法克隆
2022-02-11 本文已影响0人
响呼雷
问题
Cloning into 'outside'...
info: detecting host provider for 'https://code.aliyun.com/'...
info: detecting host provider for 'https://code.aliyun.com/'...
remote: Counting objects: 93788, done.
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
解决
第一步:克隆深度设置为1
git clone 仓库地址 --depth 1
cd 项目根目录
第二部:拉去当前完整分支
git fetch --unshallow
//这一步完成相当于“git clone -b 分支 仓库地址”,但项目实在太大,克隆一个分支也是失败,个人洁癖,又喜欢把所有分支克隆到本地,如有需要继续下一步,否则这一步完成可以正常开发的。
第三步:跟踪所有其他远程分支
git remote set-branches origin '*'
第四步:拉去所有远程分支
git fetch -v