windows環境使用局部配置
Git常用的有兩種協議
不同的協議他的代理配置各不相同。core.gitproxy 用於 git:// 協議,http.proxy 用於 http:// 協議。 常見的git clone 協議如下: 不走代理: #使用http://協議 git clone https://github.com/EasyChris/baidu.git #使用git://協議 git clone git@github.com:EasyChris/baidu.git 走代理方式: #使用http://協議 git clone -c http.proxy="http://127.0.0.1:1080" https://github.com/madrobby/zepto.git #通常小飛機的代理在本機地址是127.0.0.1 代理端口是1080 git config http.proxy 'socks5://127.0.0.1:1080' #使用git://協議 git config core.gitProxy 'socks5://127.0.0.1:1080'
windows環境下增加全局配置
git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080'
查看你的全局配置
git config --global -l