0
点赞
收藏
分享

微信扫一扫

230123-Git命令行代理及加速设置

沈芏 2023-04-03 阅读 57


⭐️ 方法1: 设置全局国内/国外代理

git config --global http.proxy http://127.0.0.1:XXXX
git config --global https.proxy http://127.0.0.1:XXXX

230123-Git命令行代理及加速设置_git

⭐️ 方法2: 仅设置github的代理

git config --global http.https://github.com.proxy http://127.0.0.1:XXXX
git config --global https.https://github.com.proxy https://127.0.0.1:XXXX

230123-Git命令行代理及加速设置_github_02

⭐️ 取消代理及查看代理

  • 查看是否有代理?无输出则无代理

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

  • 取消代理

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

git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy

⭐️ 参考文献

  • 2022-10-13 解决git clone 出现 Failed to connect to github.com port 443: Connection refused - 简书
  • git clone一个github上的仓库,太慢,经常连接失败,但是github官网流畅访问,为什么? - 知乎


举报

相关推荐

0 条评论