Git设置代理访问Github

157 阅读1分钟

本文由 简悦 SimpRead 转码, 原文地址 blog.csdn.net

假如只针对 Github:

git config --global http.https://github.com.proxy http://127.0.0.1:XXXX
git config --global https.https://github.com.proxy https://127.0.0.1:XXXX

假如使用 sock5

git config --global http.https://github.com.proxy socks5://127.0.0.1:XXXX
git config --global https.https://github.com.proxy socks5://127.0.0.1:XXXX

取消上面代理

git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy

假如对 git 的所有域名

git config --global http.proxy 'http://127.0.0.1:XXXX'
git config --global https.proxy 'http://127.0.0.1:XXXX'