【 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
相关推荐
书山有鹿9 分钟前
MaxKB v2.7.0 Rocky Linux 9 部署手册
linux·运维·maxkb·rockylinux 9
Mapleay12 分钟前
ALSA PCM 数据搬运模式
linux
小码狐23 分钟前
GIT相关
git·idea·基础
feng68_39 分钟前
Ansible还原数据库节点
linux·运维·数据库·ansible
来鸟 鸣间44 分钟前
oops问题定位记录
linux·c语言
C^h1 小时前
RTthread中的内存池理解
linux·数据库·c++·算法·嵌入式
司南-70491 小时前
claude初探- 国内镜像安装linux版claude
linux·运维·服务器·人工智能·后端
为美好的生活献上中指1 小时前
*Java 沉淀重走长征路*之——《Linux 从入门到企业实战:一套六步法,带你打通运维与开发的任督二脉》
java·linux·运维·开发语言·阿里云·华为云·linux命令
the sun341 小时前
从Ubuntu迁移到QEMU驱动开发
linux·驱动开发·ubuntu
犽戾武1 小时前
机械臂 VR 遥操作调试日志记录
linux·服务器·网络