Git 设置全局代理

  • 原创
  • Madman
  • /
  • /
  • 0
  • 7076 次阅读

Synopsis: 为 Git 工具设置全局代理,Go 安装包时也会用到 git 工具

1. 查看当前代理

# git config --global http.proxy
# git config --global https.proxy

2. 设置代理

我安装的 v2rayN 客户端默认监听本地 10808 端口(socks5 协议),此端口加 1 即为监听的 HTTP 协议端口(10809

# git config --global http.proxy 'socks5://127.0.0.1:10808'
# git config --global https.proxy 'socks5://127.0.0.1:10808'

或者:
# git config --global http.proxy 'http://127.0.0.1:10809'
# git config --global https.proxy 'http://127.0.0.1:10809'

3. 删除代理

# git config --global --unset http.proxy
# git config --global --unset https.proxy
未经允许不得转载: LIFE & SHARE - 王颜公子 » Git 设置全局代理

分享

作者

作者头像

Madman

如需 Linux / Python 相关问题付费解答,请按如下方式联系我

0 条评论

暂时还没有评论.

专题系列

文章目录