Git set http proxy & unset proxy

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)