美文网首页Git
Git set http proxy & unset proxy

Git set http proxy & unset proxy

作者: JaedenKil | 来源:发表于2020-02-11 11:25 被阅读0次

There is an error when do git clone:

$ git clone http://xxx.git
Cloning into 'yyy'...
fatal: unable to access 'xxx.git/': Could not resolve host: zzz.com

This issue occurs when I work at home, set a proxy to visit the company web sites in the Windows 10 settings, but it turns out I have the set the proxy for git separately:

git config --global http.proxy $http_proxy
git config --global https.proxy $https_proxy

Check the configs with the following command:

git config --list

In case the proxy related command goes wrong, I can unset it via the following commands:

git config --global --unset http.proxy
git config --global --unset https.proxy

相关文章

网友评论

    本文标题:Git set http proxy & unset proxy

    本文链接:https://www.haomeiwen.com/subject/wentfhtx.html