Git设置代理服务器

方式一

  • 如果说使用的是项目http或者https地址,就配置http与https代理即可,输入以下命令:
shell 复制代码
git config --global http.proxy "socks5://127.0.0.1:1080"
git config --global https.proxy "socks5://127.0.0.1:1080"

这样使用git clone/push/pull所有http或者https地址项目都会走代理。

  • 还可以使用下面命令取消代理设置:
shell 复制代码
git config --global --unset http.proxy
git config --global --unset https.proxy

方式二

  • 在.git中的config文件中增加
shell 复制代码
[http]
    proxy = http://127.0.0.1:1080
[https]
    proxy = http://127.0.0.1:1080
相关推荐
解道Jdon9 小时前
[Budi插件:VsCode状态栏显示Copilot使用情况
ide·windows·git·svn·eclipse·github·visual studio
kisshyshy9 小时前
掌握 Git 基础
git
全糖可乐气泡水10 小时前
Codex适配国产信创环境安装部署与技术适配全解析
开发语言·git·python·算法·百度
一只大袋鼠12 小时前
Git 四种仓库连接方式操作指南
git
活宝小娜15 小时前
git windows安装教程
git
青春喂了后端17 小时前
Go Sidecar Repository 并发锁改造:让并发请求安全地进入 Git 仓库层
git·安全·golang
小雨青年17 小时前
GitHub Actions 工作流性能优化实战,先看瓶颈,再改缓存和并发
git
0x000719 小时前
Git Bash 中无法启动 Claude Code ?
开发语言·git·bash
xuhaoyu_cpp_java19 小时前
Git学习(六)
git·学习
happyness441 天前
Git:AI编程时代的“安全带“与“时光机“
git·ai编程