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
相关推荐
超梦dasgg15 小时前
工作中 Git 完整使用指南(职场实战版)
git
Ws_15 小时前
Git + Gerrit 第七课:stash 临时保存工作区修改
git
enjoywindstorm16 小时前
git从入门到精通
git
Adorable老犀牛20 小时前
Git 发布正式版本的一个专属的硬核功能,叫做 打标签(Tag)。
git
我先去打把游戏先1 天前
Ubuntu虚拟机(服务器版本)Git卸载完全教程——彻底移除与清理配置
服务器·git·单片机·嵌入式硬件·物联网·ubuntu·51单片机
不做无法实现的梦~1 天前
Git Clone 使用 Watt/Steam++ 加速时报证书错误的原因与解决方法
大数据·git·elasticsearch
黑猫警长丶1 天前
Git 操作笔记
笔记·git
MageGojo1 天前
Whois 域名查询 API 接入实战:用一个 GET 请求获取域名注册信息
java·git·github
黑猫警长丶1 天前
Git 本地操作基础
git
白狐_7981 天前
从功能开发到开源维护:一个 Python 可视化项目的 Git 分支、维护文件与 PR 流程实践
git·python·开源