【 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
相关推荐
光而不耀@lgy29 分钟前
C++初登门槛
linux·开发语言·网络·c++·后端
偶尔微微一笑38 分钟前
AI网络渗透kali应用(gptshell)
linux·人工智能·python·自然语言处理·编辑器
Run1.1 小时前
深入解析 Linux 中动静态库的加载机制:从原理到实践
linux·运维·服务器
The Mr.Nobody1 小时前
STM32MPU开发之旅:从零开始构建嵌入式Linux镜像
linux·stm32·嵌入式硬件
老兵发新帖1 小时前
Ubuntu 上安装 Conda
linux·ubuntu·conda
秋秋秋秋秋雨1 小时前
linux安装单节点Elasticsearch(es),安装可视化工具kibana
linux·elasticsearch·jenkins
jstart千语2 小时前
【Git】连接github时的疑难杂症(DNS解析失败)
git·github
码农hbk2 小时前
linux ptrace 图文详解(七) gdb、strace跟踪系统调用
linux·服务器
hotlinhao2 小时前
ThinkPHP6模型中多组条件逻辑或Or查询的使用
linux·服务器·数据库
工具罗某人2 小时前
TortoiseGit使用图解
git