【 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
相关推荐
天朝八阿哥10 小时前
Bye~~ win10!
linux·windows
孙同学_10 小时前
【Linux篇】软链接vs硬链接:Linux文件系统中的两种引用机制
linux·运维·服务器
hour_go10 小时前
解决Linux系统中“undeclared identifier“问题的完整指南
linux·运维·服务器
今禾11 小时前
Git完全指南(下篇):Git高级技巧与问题解决
前端·git·github
天赐细莲11 小时前
(Linux) WSL 通过 VSCode 连接不执行 profile 问题(登录Shell问题)
linux·运维·vscode
咬_咬11 小时前
Linux时间轮定时器
linux·运维·网络·定时器·timerfd
LCG元11 小时前
Linux Shell脚本编程实战:自动备份网站文件和数据库,并定期清理过期备份
linux
Liu1bo11 小时前
【MySQL】表的约束
linux·数据库·mysql
MC皮蛋侠客12 小时前
Ubuntu禁用系统手势,阻止应用程序异常最小化
linux·运维·qt·ubuntu
颇有几分姿色12 小时前
Ubuntu 系统安装教程(二):系统安装
linux·运维·ubuntu