Git 设置代理

2025-05-20 10:11

全部代理

git 所有的访问都使用代理:

git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080

部分代理

只针对 github.com 设置代理:

# 只设置这一条即可。注意不是 https.https:github.com.proxy
git config --global http.https://github.com.proxy http://127.0.0.1:1080

临时代理

直接在 git 命令行中临时使用代理:

git clone https://github.com/user/repo.git -c http.proxy=http://127.0.0.1:1080

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global --unset http.https://github.com.proxy

查看代理

git config --global --list
0791-85271700
QQ咨询:1779755751
QQ交流群:626599871
微信咨询
微信扫码咨询
微信交流群
微信交流群
Powered by UJCMS © 2010-2025 All Rights Reserved
QQ咨询
电话
微信
微信扫码咨询