一、打开代理,在cmd中输入以下指令:
git config --global http.proxy "proxy3.bj.petrochina:8080"
git config --global https.proxy "proxy3.bj.petrochina:8080"
二、取消代理修改:
git config --global --unset http.proxy
git config --global --unset https.proxy
三、以下为建议:
上述方法挂了全局代理,但是如果要克隆码云、coding等国内仓库,速度就会很慢。更好的方法是只对github进行代理,不会影响国内仓库:
git config --global http.https://github.com.proxy "proxy3.bj.petrochina:8080"
git config --global https.https://github.com.proxy "proxy3.bj.petrochina:8080"