使用 SOCKS 代理

持久配置

修改配置文件(选项http.proxy适用于HTTP与HTTPS协议):

# 配置当前仓库,以及取消配置
git config http.proxy 'socks5://127.0.0.1:7070'
git config --unset http.proxy

# 全局配置,以及取消配置
git config --global http.proxy 'socks5://127.0.0.1:7070'
git config --global --unset http.proxy

临时配置

仅对本次克隆有效:

git clone https://github.com/xxxxx --config 'http.proxy=socks5://127.0.0.1:1234'

ALL_PROXY='socks5://127.0.0.1:8888' git clone https://github.com/some/one.git

参考文献

K4NZ/设置网络加速
Using a socks proxy with git for the http transport


相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2021-07-06
  • 2021-09-14
  • 2022-02-16
  • 2022-01-06
  • 2021-10-19
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2022-01-17
  • 2021-10-28
  • 2021-08-29
  • 2022-02-19
  • 2021-10-06
  • 2022-02-22
相关资源
相似解决方案