【 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
相关推荐
yunwei376 分钟前
eBPF 教程:追踪 CUDA GPU 操作
linux·后端·性能优化
Android系统攻城狮9 分钟前
Linux Gstreamer深度解析之gst_audio_channel_reorder_map调用流程与实战(十八)
linux·运维·服务器·音视频进阶·gstreamer音视频进阶
新时代牛马1 小时前
Linux 防火墙:nftables 与iptables 兼容层
linux·运维·服务器
彧azz1 小时前
Git 入门实操实例:从安装到远程仓库全流程
大数据·笔记·git·学习·elasticsearch
ao-weilai2 小时前
Linux网络编程:网络知识基础
linux·网络·php
GeW3 小时前
RHCE10一次过!提高通过率+快速拿证的7个核心技巧
linux
浅念-3 小时前
C++ Protobuf 入门实战:基于通讯录项目吃透proto3语法与序列化
linux·服务器·网络·c++·protobuf·proto·proto3
不怕犯错,就怕不做3 小时前
RK linux在buildroot中如何添加linux命令
linux·驱动开发·嵌入式硬件
小羊在睡觉4 小时前
HLS视频
linux·后端·golang
宵时待雨4 小时前
linux笔记归纳18:传输层协议TCP
linux·网络·笔记·网络协议·tcp/ip