【 Git 设置代理】

【 Git 设置代理】

  • [1. 设置代理](#1. 设置代理)
  • [2. 检查当前 Git 代理](#2. 检查当前 Git 代理)
  • [3. 测试代理是否正常](#3. 测试代理是否正常)
  • [4. 查看Git所有配置](#4. 查看Git所有配置)
  • [5. 取消添加的代理](#5. 取消添加的代理)

1. 设置代理

添加 HTTP 和 HTTPS 代理:

bash 复制代码
git config --global http.proxy http://127.0.0.1:10809
git config --global https.proxy http://127.0.0.1:10809

添加 Socks5 代理:

bash 复制代码
git config --global http.proxy socks5://127.0.0.1:10808
git config --global https.proxy socks5://127.0.0.1:10808

2. 检查当前 Git 代理

bash 复制代码
git config --global --get http.proxy
git config --global --get https.proxy

3. 测试代理是否正常

尝试通过 Git 克隆一个公共仓库,例如:

bash 复制代码
git clone https://github.com/comfyanonymous/ComfyUI.git

如果克隆成功且速度正常,则说明代理设置成功。

4. 查看Git所有配置

bash 复制代码
git config -l

5. 取消添加的代理

bash 复制代码
git config --global --unset http.proxy
git config --global --unset https.proxy
相关推荐
Championship.23.2413 小时前
Linux 3.0 锁机制与故障排查详解
linux·运维·服务器
养肥胖虎13 小时前
Git提交规范笔记:feat和fix到底该怎么写
git·conventionalcommits
天疆说13 小时前
Zotero Connector 在 Edge 里找不到桌面 Zotero(Linux / Zotero 9.0.6 / Edge 150)
linux·前端·edge
手握风云-13 小时前
深入 Git:它是如何记录世界的(二)
git
风123456789~15 小时前
【Linux专栏】ls 排除某个文件
linux·运维·服务器
IT曙光15 小时前
ubuntu apt-get离线源制作
linux·ubuntu
其实防守也摸鱼16 小时前
运维--学习阶段问题解答(1)(自测)
linux·运维·服务器·数据库·学习·自动化·命令模式
懒鸟一枚16 小时前
深入理解 Linux 内存、Swap 交换分区与分页机制的关系
java·linux·数据库
Darkwanderor17 小时前
对Linux的进程控制的研究
linux·运维·c++
bksczm20 小时前
linux之线程概念和控制
linux·开发语言·c++