最近参与了一个新项目,在使用git clone 克隆代码时遇到了一个报错"fatal: unable to access ‘https://example.git/’: Failed to connect to 127.0.0.1 port 31181: Connection refused",今天就和大家分享下解决过程。

报错详情

在使用git clone 克隆远程仓库的代码时报错"fatal: unable to access ‘https://example.git/’: Failed to connect to 127.0.0.1 port 31181: Connection refused",详情如下:

git拉去代码报错“Failed to connect to 127.0.0.1 port 31181: Connection refused“_sed

报错原因

在windows中使用代理时,由于一些其它的原因,未能在关闭代理时修正对 git 客户端配置的影响。导致git的代理配置未能修改回来。

解决方法

取消代理

打开git bash窗口,执行以下命令查看代理:

git config --global http.proxy

git拉去代码报错“Failed to connect to 127.0.0.1 port 31181: Connection refused“_git_02

执行以下命令取消代理:

git config --global --unset http.proxy