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
相关推荐
相与还2 小时前
IDEA和GIT实现cherry pick拣选部分变更到新分支
git·elasticsearch·intellij-idea
刘志辉8 小时前
git指令
git
2501_9167665411 小时前
【Git学习】初识git:简单介绍及安装流程
git·学习
孤独的追光者14 小时前
Git 完整流程:从暂存到推送
git
平平无奇。。。14 小时前
版本控制器之Git理论与实战
linux·git·gitee·github
这周也會开心1 天前
Git介绍和使用
git
小龙报1 天前
《彻底理解C语言指针全攻略(3)》
c语言·开发语言·windows·git·创业创新·学习方法·visual studio
前端备忘录1 天前
创建好git项目仓库后如何将本地项目传上去
git
代码or搬砖1 天前
Git学习笔记(二)
笔记·git·学习
sineiy1 天前
git使用教程
git