Git Config VPN

2019-02-27 14:10:43 284

Git Config VPN

  • Shadowsocks客户端会提供一个本地的socks5协议代理
    启动Shadowsocks>>偏好设置>>高级>>本地Socks5监听端口 (默认为 1086)
  • 配置Socks协议代理git命令
git config --global http.proxy socks5://127.0.0.1:1086
git config --global https.proxy socks5://127.0.0.1:1086
  • 配置sample
zhenglubiaodeMacBook-Pro:~ zlb$
zhenglubiaodeMacBook-Pro:~ zlb$ cd ~
zhenglubiaodeMacBook-Pro:~ zlb$
zhenglubiaodeMacBook-Pro:~ zlb$ pwd
/Users/zlb
zhenglubiaodeMacBook-Pro:~ zlb$
zhenglubiaodeMacBook-Pro:~ zlb$ cat ./.gitconfig
[core]
    autocrlf = input
zhenglubiaodeMacBook-Pro:~ zlb$
zhenglubiaodeMacBook-Pro:~ zlb$
zhenglubiaodeMacBook-Pro:~ zlb$ git config --global http.proxy socks5://127.0.0.1:1086
zhenglubiaodeMacBook-Pro:~ zlb$ git config --global https.proxy socks5://127.0.0.1:1086
zhenglubiaodeMacBook-Pro:~ zlb$
zhenglubiaodeMacBook-Pro:~ zlb$ cat ./.gitconfig
[core]
    autocrlf = input
[http]
    proxy = socks5://127.0.0.1:1086
[https]
    proxy = socks5://127.0.0.1:1086
zhenglubiaodeMacBook-Pro:~ zlb$
  • 取消配置git命令
zhenglubiaodeMacBook-Pro:~ zlb$ git config --global --unset http.proxy
zhenglubiaodeMacBook-Pro:~ zlb$ git config --global --unset https.proxy
  • 配置postBuffer大小
git config --global http.postBuffer 524288000
git config --global https.postBuffer 524288000
  • 只对github进行代理,对国内的仓库
git config --global http.https://github.com.proxy socks5://127.0.0.1:1086
git config --global https.https://github.com.proxy socks5://127.0.0.1:1086
  • tip 还有可能是网络问题,使用其他网络
  • sample
zhenglubiaodeMacBook-Pro:lb zlb$ cat ~/.gitconfig 
[core]
    autocrlf = input
[http]
    postBuffer = 1048576000
    proxy = socks5://127.0.0.1:1086
[https]
    postBuffer = 1048576000
    proxy = socks5://127.0.0.1:1086
zhenglubiaodeMacBook-Pro:lb zlb$ 
zhenglubiaodeMacBook-Pro:lb zlb$ 

云栖社区 Shadowsocks 配置 vpn Core git unset github input

作者

boulcheng
TA的文章

相关文章