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

649 阅读1分钟

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

报错详情

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

报错原因

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

解决方法

取消代理

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

git config --global http.proxy

_20240529081152.jpg

_20240529081152.jpg

执行以下命令取消代理:

git config --global --unset http.proxy