【 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
相关推荐
wdfk_prog几秒前
[Linux]学习笔记系列 -- [drivers][mmc]mmc_sd
linux·笔记·学习
qinyia1 分钟前
**使用AI助手在智慧运维中快速定位并修复服务异常:以Nginx配置错误导致502错误为例**
linux·运维·服务器·数据库·mysql·nginx·自动化
❀͜͡傀儡师2 分钟前
CentOS 7部署FTP服务
linux·运维·centos·ftp
济6175 分钟前
ARM Linux 驱动开发篇----字符设备驱动开发(2)--字符设备驱动开发步骤---- Ubuntu20.04
linux·运维·服务器
仗剑天涯 回首枉然11 分钟前
Linux 和 windows 共享文件
linux·运维·windows
zzzsde13 分钟前
【Linux】进程(3):进程状态
linux·运维·服务器
Mr_liu_66614 分钟前
ubuntu:beyond compare 4 This license key has been revoked——————转载拼接
linux·运维·ubuntu
无聊的小坏坏14 分钟前
补充:使用 /etc/cron.d 管理定时任务
linux·定时任务
热爱生活的五柒19 分钟前
linux/mac/wsl如何使用claude code,并配置免费的硅基流动API?(官方的需要付费订阅)
linux·运维·macos
wefg125 分钟前
【Linux】动静态库
linux·运维·restful