【 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
相关推荐
code-vibe9 分钟前
物理机 kali 改造笔记 (一)
linux·运维·服务器
老黄编程19 分钟前
03-gpg(证书管理 )详细范例
linux·运维·ubuntu·数字证书
莱茶荼菜1 小时前
Ubuntu 20.04 系统库管理详细教程
linux·运维·ubuntu
迅为电子2 小时前
嵌入式Linux新手入门:北京迅为3568开发板驱动开发第二章helloworld 驱动实验
linux·运维·驱动开发
☆cwlulu4 小时前
git分支管理详解
开发语言·git·青少年编程
nono牛5 小时前
MTK平台详解`adb devices`输出的序列号组成
android·linux·adb·智能手机
catoop6 小时前
Linux 自动清理临时文件配置
linux·服务器
Xの哲學6 小时前
Linux eMMC子系统深度解析:从硬件协议到内核实现
linux·网络·算法·架构·边缘计算
亚林瓜子6 小时前
在amazon linux 2023上面通过Fedora 36软件仓库源安装tesseract5
linux·运维·服务器·ocr·tesseract·amazon·fedor
是专家不是砖家6 小时前
linux USB摄像头不停掉线问题
linux·运维·服务器