【 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
相关推荐
l1x1n03 小时前
Vim 编辑器常用操作详解(新手快速上手指南)
linux·编辑器·vim
jingshaoqi_ccc4 小时前
GitKraken最后一个免费版本和下载地址
git·github·gitkraken·版本管理工具
乌云暮年4 小时前
Git简单命令
git·gitee·github·batch命令
ajassi20004 小时前
开源 python 应用 开发(三)python语法介绍
linux·python·开源·自动化
o不ok!4 小时前
Linux面试问题-软件测试
linux·运维·服务器
DaxiaLeeSuper4 小时前
Prometheus+Grafana+node_exporter监控linux服务器资源的方案
linux·grafana·prometheus
尽兴-6 小时前
如何将多个.sql文件合并成一个:Windows和Linux/Mac详细指南
linux·数据库·windows·sql·macos
kfepiza6 小时前
Netplan 中 bridges、bonds、ethernets、vlans 之间的关系 笔记250711
linux·tcp/ip·shell
小小不董6 小时前
深入理解oracle ADG和RAC
linux·服务器·数据库·oracle·dba
用户1259265423207 小时前
使用 Docker 搭建 Gitea 并实现 Git HTTP 自动登录
git