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
相关推荐
Joy-鬼魅3 小时前
Git常用操作
git
流浪0017 小时前
Git篇(三):吃透远程协作:SSH 密钥、分支、标签全流程实战指南
运维·git·ssh
莫成1 天前
git相关命令查阅
git
ljh5746491191 天前
git stash 和 git stash apply
git
慕容引刀1 天前
告别Commit信息纠结:使用Git AI Commit插件实现规范化提交
人工智能·git·github·visual studio code·visual studio
敲代码的嘎仔2 天前
实习日志day6--实习日志day6--title命名规范化&businessType纠正&补充缺失的@Log注解&报警与通信模块补充&产出阶段总结文档
java·开发语言·人工智能·git·python·实习·大二
刘马想放假2 天前
Git 从入门到进阶:一篇吃透版本管理的实战指南
git·gitlab
开发者联盟league2 天前
git commit报错No .pre-commit-config.yaml file was found
git
猫老板的豆2 天前
git实战
git
风曦Kisaki2 天前
# Linux实战笔记-HIS项目实战Day01:版本控制与Git基础
linux·笔记·git