从github下载项目下来,由于项目提交历史过多等各种原因导致文件太大,clone的时候非常的慢,或者直接出现
error: RPC failed; curl 18 transfer closed with outstanding read data remainingfatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
报错,终止下载
两种办法:
1、修改hosts文件,增加映射,这样可以加快clone速度:
151.101.44.249 github.global.ssl.fastly.net
192.30.253.112 github.com
2、避免报错导致下载终止:在clone后面加上参数:--depth 1
,设置clone深度为1,来解决这个问题
git clone https://github.com/xxx/xxx.git --depth 1