git配置代理


git

# socks5协议,v2ray默认监听10808端口
$ git config –global http.proxy socks5://127.0.0.1:10808
$ git config –global https.proxy socks5://127.0.0.1:10808
# http协议,v2ray默认监听10809端口
$ git config –global http.proxy http://127.0.0.1:10809
$ git config –global https.proxy https://127.0.0.1:10809
# 查看设置
$ git config -l

github

如果单独给github配置代理,设置如下:

# 走 socks5 代理
$ git config --global http.https://github.com.proxy "socks5://127.0.0.1:1080"
# 走 http 代理
$ git config --global http.https://github.com.proxy "http://127.0.0.1:10809"
# 取消设置
$ git config --global --unset http.https://github.com.proxy

npm

$ npm config set proxy http://127.0.0.1:10809
$ npm config set https-proxy http://127.0.0.1:10809

scoop

$ scoop config proxy 127.0.0.1:10809

参考链接:
各常用包管理器配置科学上网代理
使用V2ray对Git进行加速


文章作者: moea
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 moea !
  目录