1. 报错
fatal: unable to access 'https://github.com/asmaloney/libE57Format/': error:02FFF036:system library:func(4095):Connection reset by peer
2. 原因:
网络原因,使用https的方式总是无法完成下载。
可在github上随便找个仓库,试试可以使用https吗?如果不可以的话,使用第3点解决方案,否则,尝试第四点。
3.解决方案1(https clone失败)
git config --global url.git@github.com:.insteadOf https://github.com/
此命令的作用是将所有git clone的url中包含https://github.com/的都替换为git@github.com:,以ssh的方式去执行git clone,例如:
git clone https://github.com/envoyproxy/data-plane-api.git
执行了上边的命令后,将转为
git clone git@github.com:envoyproxy/data-plane-api.git
4. 其他方案
4.1 修改gitconfig,增大缓存
git config --global http.postBuffer 524288000
git config --global https.postBuffer 524288000
4.2 修改host,增加以下ip域名
140.82.113.3 github.com
146.75.77.194 github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
4.3 修改gitconfig,取消http代理
git config --global --unset http.proxy
git config --global --unset https.proxy
参考: