fatal: unable to access '': Failed to connect to 127.0.0.1 port 1087: Connection refused`或者`fatal...

在通过git之类的工具clone、pull或push的时候偶尔会出现fatal: unable to access '': Failed to connect to 127.0.0.1 port 1087: Connection refused或者fatal: unable to access ‘‘: The requested URL returned error: 500这类的错误。不要多想,肯定是使用了代理网上解决方法很多,但不一定有效,尝试一个小时也不一定能解决。下面推荐亲测有效方法:

  • 在终端输入指令: env|grep -I proxy,查看使用了的代理
ryf@renyunfeideMBP % env|grep -I proxy 

// 这是我的返回
all_proxy=socks5://127.0.0.1:1087
http_proxy=http://127.0.0.1:1087
https_proxy=http://127.0.0.1:1087
  • 取消代理
unset all_proxy http_proxy https_proxy

一般这两步操作之后都能正常的克隆、拉/推代码了,或者是在使用env|grep -I proxy查看下。已亲测有效,希望对各位能有帮助。

你可能感兴趣的:(fatal: unable to access '': Failed to connect to 127.0.0.1 port 1087: Connection refused`或者`fatal...)