解决git clone时,出现Failed to connect to 127.0.0.1 拒绝连接的问题

    原因是127.0.0.1 端口被当作代理占用了,需要重启。

    首先,输入

  env|grep -i proxy  

    查看代理设置情况,

    NO_PROXY=localhost,127.0.0.0/8,::1
http_proxy=http://127.0.0.1:46759/
https_proxy=http://127.0.0.1:46759/
HTTPS_PROXY=http://127.0.0.1:46759/
no_proxy=localhost,127.0.0.0/8,::1
HTTP_PROXY=http://127.0.0.1:46759/

  可以看出,46759端口确实被占用了,需要unset所有与46759有关的代理。

  然后git clone就恢复正常了。

unset http_proxy

unset https_proxy

unset HTTP_PROXY

unset HTTPS_PROXY

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章