git代理设置

1.单独配置项目代理

进入项目目录:

进入你想要配置代理的项目目录。

设置 HTTP 或 HTTPS 代理:

使用以下命令为该项目配置代理:

git config http.proxy http://proxy.example.com:port
git config https.proxy http://proxy.example.com:port

http://proxy.example.com:port 替换为你的代理地址和端口。

移除代理设置:

如果想要移除代理设置,可以使用:

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

检查当前配置:

查看当前项目的 Git 配置,包括代理设置:

git config --list

2.配置全局代理

设置 HTTP 或 HTTPS 代理:

使用以下命令为该项目配置代理:

git config --global http.proxy http://proxy.example.com:port
git config --global https.proxy http://proxy.example.com:port

移除全局代理设置:

要删除之前设置的全局 Git 代理,可以使用以下命令:

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

这将移除全局范围内的 HTTP 和 HTTPS 代理设置。如果你想确认代理已被移除,可以查看全局配置:

git config --global --list

这会显示当前的全局配置,确保其中不再包含 http.proxy 或 https.proxy。

posted @   BuerH  阅读(1816)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示