Git设置代理

Git设置代理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 设置全局代理
# http
git config --global https.proxy http://127.0.0.1:1080
# https
git config --global https.proxy https://127.0.0.1:1080
# socks5
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

# 只对github.com使用代理,其他仓库不走代理
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

# 取消github代理
git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy

# 取消全局代理
git config --global --unset http.proxy
git config --global --unset https.proxy
作者

路远

发布于

2022-09-04

更新于

2023-04-21

许可协议