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

简介: 在克隆`https://example.git/`时遇到错误:"fatal: unable to access 'https://example.git/': Failed to connect to 127.0.0.1 port 31181: Connection refused"。原因是Windows上代理设置未正确关闭,影响了Git配置。解决方法是通过git bash运行命令检查并取消代理:`git config --global http.proxy`和`git config --global --unset http.proxy`。

最近参与了一个新项目,在使用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",详情如下:
_20240529081134.jpg

报错原因

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

解决方法

取消代理

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

git config --global http.proxy

_20240529081152.jpg

执行以下命令取消代理:

git config --global --unset http.proxy
目录
相关文章
|
19天前
|
缓存 开发工具 git
windows系统通过git上传代码
windows系统通过git上传代码
|
11天前
|
开发工具 git 开发者
【git merge/rebase】详解合并代码、解决冲突
【git merge/rebase】详解合并代码、解决冲突
29 0
|
5天前
|
Shell 测试技术 网络安全
【GIT】如何在GitHub上向一个开源项目贡献代码?
【GIT】如何在GitHub上向一个开源项目贡献代码?
21 5
|
12天前
|
开发工具 git
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
|
18天前
|
开发工具 git
MAC如何使用Git命令行上传本地项目及理解,failed to push some refs to ‘https://gitee.com/brother-barking/spxx.git
MAC如何使用Git命令行上传本地项目及理解,failed to push some refs to ‘https://gitee.com/brother-barking/spxx.git
|
11天前
|
敏捷开发 测试技术 持续交付
【git分支管理策略】如何高效的管理好代码版本
【git分支管理策略】如何高效的管理好代码版本
23 0
|
19天前
|
测试技术 持续交付 API
Git 代码提交注释管理规范
Git 代码提交注释管理规范
16 0
|
开发工具 git
git出现报错:src refspec master does not match any
git出现报错:src refspec master does not match any
644 0
|
1月前
|
缓存 数据可视化 网络安全
Git命令大全
Git命令大全
70 1
|
1月前
|
开发工具 git
Git教程:深入了解删除分支的命令
【4月更文挑战第3天】
200 0
Git教程:深入了解删除分支的命令