【已解决】git clone 失效,fatal: unable to access ‘https://github.com/XXX.git/‘: Recv failure: C

问题:

$ git clone https://github.com/d2-projects/d2-admin.git
Cloning into ‘d2-admin’…
fatal: unable to access ‘https://github.com/d2-projects/d2-admin.git/’: Recv failure: Connection was reset

在这里插入图片描述

解决方案:

先刷新DNS
win+R, cmd
在这里插入图片描述

输入:

ipconfig/flushdns

在这里插入图片描述

删除全局的 HTTP 代理设置,让 Git 回到直接连接状态

git config --global --unset http.proxy

在这里插入图片描述
git config 用于配置 Git 的各种选项
–global 表示这是一个全局的配置,不限于某个特定仓库
–unset 表示这个动作是取消设置,删除某个值
http.proxy 则表示要取消全局的 HTTP protocol 的 proxy 代理设置
所以整条命令意思是:

取消全局范围内 Git 对于 HTTP 协议所设置的代理配置。

解决

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40887836/article/details/132426977