linux系统git时有代理(解决git clone时,出现Failed to connect to 127.0.0.1 port 46759: 拒绝连接的问题)

使用Github pull 代码突然报错:

Failed to connect to 127.0.0.1 port 43421: Connection refused

使用 lsof 发现端口未被占用:lsof -i:45463

查看代理:env|grep -i proxy

NO_PROXY=localhost,127.0.0.0/8,::1

http_proxy=http://127.0.0.1:45463/

HTTPS_PROXY=http://127.0.0.1:45463/

https_proxy=http://127.0.0.1:45463/

no_proxy=localhost,127.0.0.0/8,::1

HTTP_PROXY=http://127.0.0.1:45463/

原因:使用代理导致访问失败

解决方法:(取消代理使用)

 export http_proxy=""
 export https_proxy=""
 export HTTP_PROXY=""
 export HTTPS_PROXY=""

猜你喜欢

转载自blog.csdn.net/uzizi/article/details/81258813