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
相关推荐
XS03010617 小时前
Git远程仓库实操笔记
笔记·git·elasticsearch
Java成神之路-17 小时前
Git 合并冲突完全指南:分支合并、拉取冲突、推送冲突
git
NutShell Wang17 小时前
拆解 GitHub gh-stack:堆叠 PR 工作流的设计取舍与工程实现
前端·git·开源·github·代码复审·开发者工具·vibe coding
咩咩啃树皮17 小时前
第62篇:Git团队协作完整流程——企业多人开发规范、分支管理、冲突解决、上线流程(最终封笔篇)
git
.Hypocritical.1 天前
Git 入门教程
git
AI行业学习2 天前
Claude Code + cc-switch + Git + Node.js 全套下载+安装+配置完整版
开发语言·git·python·前端框架·node.js·html·notepad++
豆角焖肉2 天前
.gitignore:配置文件+初学入门
git·gitignore
月落归舟2 天前
Git 新手入门指南
git
达达车2 天前
git使用技巧记录
git·使用技巧·版本管理
Simon—欧阳2 天前
Git使用心得&理解
git