墨少离 - 个人小站,分享一些资源以及心得~ - Git 2021-04-16T09:26:07+08:00 Typecho https://www.msl.la/feed/atom/tag/Git/ <![CDATA[Git 设置代理和取消代理]]> https://www.msl.la/archives/268/ 2021-04-16T09:26:07+08:00 2021-04-16T09:26:07+08:00 墨少离 https://www.msl.la/ 如果代理类型是 socks5 进行如下设置即可:

git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

如果是普通的 http/https 进行如下设置即可:

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080

取消代理设置:

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