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
相关推荐
无心水20 小时前
【Hermes:安全、权限与生产环境】39、智能体也会犯错?Hermes 纠错、回滚与遗忘机制全指南 —— 让 AI 的错误像 Git 一样可逆可控
人工智能·git·安全·mcp协议·openclaw·hermes·honcho
南境十里·墨染春水1 天前
linux学习进展 git详解
linux·git·学习
zhangfeng11331 天前
CodeBuddy ai对话框上面的git docs terminal Rulds 干嘛用的,以thinkphp fastadmin 为例,插件市场
人工智能·git·编程
OYangxf1 天前
Git Conflict Resolution
大数据·git·elasticsearch
高斯林.神犇1 天前
Git全套流程
git
次元工程师!1 天前
LangFlow开发(一)—安装和部署
git·python·大模型·langflow
怣疯knight1 天前
【无标题】
git
Jim-zf1 天前
git 锁文件
git
lcx_defender1 天前
Git常见操作与指令
git
一只积极向上的小咸鱼2 天前
嵌套 Git 仓库 / gitlink / submodule 问题总结
大数据·git·elasticsearch