From 3db787451bc95b5fa5c1d93bd923dd995dddf89f Mon Sep 17 00:00:00 2001 From: offends Date: Tue, 26 Aug 2025 23:45:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Git=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Git/Git配置本地代理.md | 48 +++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/Git/Git配置本地代理.md b/Git/Git配置本地代理.md index 87f0744..dfdb030 100644 --- a/Git/Git配置本地代理.md +++ b/Git/Git配置本地代理.md @@ -4,27 +4,37 @@ > 本地启动代理后,使用命令更改端口 -```bash -# socks5协议,1080端口修改成自己的本地代理端口 -git config --global http.https://github.com.proxy socks5://127.0.0.1:1080 -git config --global https.https://github.com.proxy socks5://127.0.0.1:1080 +## 配置代理 -# http协议,1081端口修改成自己的本地代理端口 -git config --global http.https://github.com.proxy https://127.0.0.1:1081 -git config --global https.https://github.com.proxy https://127.0.0.1:1081 +- 全局代理 + + ```bash + git config --global http.proxy http://127.0.0.1:1080 + git config --global https.proxy http://127.0.0.1:1080 + ``` + +- 针对特定网站代理 + + ```bash + # http协议 + git config --global http.https://github.com.proxy https://127.0.0.1:1080 + git config --global https.https://github.com.proxy https://127.0.0.1:1080 + + # socks5协议 + git config --global http.https://github.com.proxy socks5://127.0.0.1:1080 + git config --global https.https://github.com.proxy socks5://127.0.0.1:1080 + ``` + +## 查看所有配置 + +```bash +git config --global --list ``` -- 查看所有配置 +## 取消 reset 代理设置 - ```bash - git config -l - ``` +```bash +git config --global --unset http.proxy +git config --global --unset https.proxy +``` -- 取消 reset 代理设置 - - ```bash - git config --global --unset http.proxy - git config --global --unset https.proxy - ``` - -