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
相关推荐
朝阳58123 分钟前
如何用 AI 自动生成规范的 Git 提交信息:从暂存区 diff 到 Conventional Commit
人工智能·git
hudawei99626 分钟前
有未保存的修改,不能切换分支
git·git stash·stash
康一夏1 小时前
Git Commit 规范实践:Angular Commit 规范 + Commitlint 自动化验证
git·自动化·commit msg·commit规范
LayZhangStrive5 小时前
Git - 使用IDEA和git上传本地项目到Gitee远程仓库
git·gitee·idea
云泽8085 小时前
Git 版本控制系统(上):架构原理与操作入门
linux·git·架构
绝世唐门三哥6 小时前
Git - git stash 语法演进与实战指南
前端·git
梨想橙汁6 小时前
Git 分支详解:创建切换、合并分支、冲突解决实战
前端·git
那年窗外下的雪.1 天前
AIDC 学习日志|第 21 天|EVPN 多归属故障演练与中断窗口定位
网络·git·学习
玖石书1 天前
Git Submodule 完全指南:从添加到日常维护的常规操作全流程
大数据·git·elasticsearch
微尘寒风1 天前
git创建版本库
git