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
相关推荐
csdn_aspnet1 小时前
Git灾难级误操作抢救手册:从reset到reflog的终极救援
git·恢复·误删
2401_891655812 小时前
Git + 云原生:如何管理K8s配置版本?
git·云原生·kubernetes
m0_528174453 小时前
Git对象存储原理(blob/tree/commit) 引用日志(reflog)
大数据·git·elasticsearch·全文检索
无限进步_4 小时前
【C++】单词反转算法详解:原地操作与边界处理
java·开发语言·c++·git·算法·github·visual studio
Wzx1980126 小时前
Git分布式版本控制工具
git
whale fall19 小时前
git add、git commit、git push 的区别和联系
git
倾云鹤19 小时前
Git同时推送多个远程仓库
git
sdm0704271 天前
基础开发工具git,gdb
git
胡琦博客1 天前
如何同步远程分支到本地(远程有些分支已经删除了)
git
AI成长日志1 天前
【实用工具教程】Git进阶:分支策略与合并冲突解决
git