起因
由于之前git clone或者类似操作经常出现问题,但我本身开了代理的,所以不知道出了什么问题,后面才知道需要另外设置代理,这里总结一下不同平台终端开启代理方式。
git bash
设置代理,注意端口号是你代理软件的端口
git config --global http.proxy http://127.0.0.1:9080
git config --global https.proxy https://127.0.0.1:9080如果是其他协议,直接更改后面的值即可http.proxy与https.proxy 
重置代理
git config --global --unset http.proxy
git config --global --unset https.proxyWindows powershell
$env:HTTP_PROXY="http://127.0.0.1:9080"
$env:HTTPS_PROXY="https://127.0.0.1:9080" Windows CMD
set http_proxy=http://127.0.0.1:9080
set https_proxy=http://127.0.0.1:9080MAC iterm2
export http_proxy=http://127.0.0.1:9080
export https_proxy=$http_proxy重置代理
unset http_proxy https_proxy本文由mdnice多平台发布