git时 Failed to connect to 127.0.0.1 port 1080: Connection refused

Posted tiger4513

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git时 Failed to connect to 127.0.0.1 port 1080: Connection refused相关的知识,希望对你有一定的参考价值。

在公司换了一台电脑之后发现git clone 和 npm install都失败,报错为

fatal: unable to access ‘https://github.com/netease-im/NIM_PC_UIKit/‘: Failed to connect to 127.0.0.1 port 1080: Connection refused 

产生原因:本地使用了端口代理,导致连接失败

解决办法:在本机全局搜索 gitconfig

技术图片

 

 打开文件,删除有关proxy的所有行,只删除与 proxy 有关的,其他的不用管,再次git clone 和 npm install就没有问题了

以上是关于git时 Failed to connect to 127.0.0.1 port 1080: Connection refused的主要内容,如果未能解决你的问题,请参考以下文章

failed to connect to gitee.com port 443: timed out

.git/‘: Failed to connect to 127.0.0.1 port 1080: Connection refused

.git/‘: Failed to connect to 127.0.0.1 port 1080: Connection refused

解决:Failed to connect to repository : Error performing command: git.exe ls-remote -h xxxxxxx HEAD

[转发]解决 git push Failed to connect to 127.0.0.1 port 45463: 拒绝连接

Git 拉取Gitee仓库报错:“fatal: unable to access ''": Failed to connect to 127.0.0.1 port 1080: