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
相关推荐
摆烂且佛系13 小时前
十分钟了解Git Cherry-Pick
git
星渊澈15 小时前
从github上git clone 比较慢,如何解决。。
git·github
魔都吴所谓17 小时前
【Ubuntu】离线环境下Git LFS(deb包)安装与验证完整教程
linux·git·ubuntu
REDcker17 小时前
Git worktree:多工作区并行开发与实践
git·worktree
lifewange18 小时前
Git版本管理
大数据·git·elasticsearch
尘世壹俗人18 小时前
idea提交git版本由于中文文件名卡死不动
java·git·intellij-idea
oushaojun219 小时前
git在项目中常用的操作集合
git
qq_3962279520 小时前
Git 分布式版本控制
分布式·git
无限进步_20 小时前
【C++】反转字符串的进阶技巧:每隔k个字符反转k个
java·开发语言·c++·git·算法·github·visual studio
Rabbit_QL1 天前
【Git 报错处理】`remote origin already exists` 是什么意思?
git