【 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
相关推荐
风静如云5 分钟前
OpenBMC:BmcWeb定义service
linux
leoufung26 分钟前
VIM FZF 安裝和使用
linux·编辑器·vim
bugtraq20211 小时前
XiaoMi Mi5(gemini) 刷入Ubuntu Touch 16.04——安卓手机刷入Linux
linux·运维·ubuntu
CodeWithMe2 小时前
[ Vim ] 常用命令 and 配置
linux·编辑器·vim
DC_BLOG2 小时前
Linux-GlusterFS进阶分布式卷
linux·运维·服务器·分布式
利刃大大2 小时前
【Git】五、多人协作
git
cookies_s_s3 小时前
Linux--进程(进程虚拟地址空间、页表、进程控制、实现简易shell)
linux·运维·服务器·数据结构·c++·算法·哈希算法
丁劲犇3 小时前
碳基生物的悲歌-DeepSeek思考实现Linux动态库递归收集工具
linux·递归·deepseek·ldd
zhouwu_linux3 小时前
MT7628基于原厂的SDK包, 修改ra1网卡的MAC方法。
linux·运维·macos
2401_897930064 小时前
linux系统如何配置host.docker.internal
linux·docker·eureka