【 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
相关推荐
海盗12348 分钟前
VMware 中 CentOS 7 无法使用 yum 安装 wget 的完整解决方案
linux·运维·centos
ss2731 小时前
idea中git更新项目:将传入更改合并到当前分支,在传入更改上变基当前分支
java·git·intellij-idea
hopsky1 小时前
好用!Git 同时开发多个分支
git
gtr20201 小时前
Ubuntu24.04 基于 EtherCAT 的 SVD60N 主站
linux·ethercat
weixin_462446231 小时前
ubuntu真机安装tljh jupyterhub支持跨域iframe
linux·运维·ubuntu
小码吃趴菜1 小时前
select/poll/epoll 核心区别
linux
Ghost Face...1 小时前
深入解析网卡驱动开发与移植
linux·驱动开发
a41324471 小时前
在CentOS系统上挂载硬盘到ESXi虚拟机
linux·运维·centos
MMME~1 小时前
Linux下的软件管理
linux·运维·服务器
迷途之人不知返1 小时前
Linux操作系统的基本指令
linux·服务器