【 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
相关推荐
m0_746177193 小时前
小白畅通Linux之旅-----Linux日志管理
linux·运维·服务器
菜菜笔记5 小时前
Ubuntu 挂载新盘
linux·运维·ubuntu
慌糖5 小时前
Ubuntu安装Docker命令清单(以20.04为例)
linux·ubuntu·docker
zhangzhiwei-zzw5 小时前
Linux下使用nmcli连接网络
linux·网络·chrome
枫叶落雨2225 小时前
Git 使用规范指南
git
ZZH1120KQ6 小时前
Linux账号和权限管理
linux·运维
XMAIPC_Robot6 小时前
基于 ZYNQ UltraScale+ OV5640的高速图像传输系统设计,支持国产替代
linux·数码相机·fpga开发·架构·边缘计算
水水沝淼㵘7 小时前
嵌入式开发学习日志(linux系统编程--系统编程之 进程间通信IPC)Day32
linux·运维·学习
IT小饕餮7 小时前
linux登陆硬件检测脚本
linux·运维·服务器
碎梦归途8 小时前
Linux 软件安装方式全解(适用于 CentOS/RHEL 系统)
linux·运维·centos