【 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
相关推荐
知识分享小能手20 分钟前
CentOS Stream 9入门学习教程,从入门到精通,Linux日志分析工具及应用 —语法详解与实战案例(17)
linux·学习·centos
ZXF_H33 分钟前
Linux tcpdump抓包实践(以http为例)
linux·http·wireshark·tcpdump
悄悄敲敲敲35 分钟前
Linux:信号(二)
linux·操作系统·信号
Felven1 小时前
飞腾D2000 GPIO中断调试
linux·gpio·中断·d2000
喵了meme1 小时前
Linux学习日记21:读写锁
linux·c语言·学习
^乘风破浪^2 小时前
Ubuntu部署Xingrin(星环)企业级漏洞扫描与资产管理平台
linux·运维·ubuntu
Lueeee.2 小时前
内核模块符号的导出
linux·运维·服务器
C语言魔术师2 小时前
【linux】linux进程概念(四)(环境变量)
linux·运维·服务器
松涛和鸣2 小时前
DAY32 Linux Thread Programming
linux·运维·数据库·算法·list
eggrall2 小时前
《gdb 与 cgdb 深度解析:命令行调试的效率革命》
linux