Files
Linux/Git/Git配置本地代理.md
offends 3db787451b
All checks were successful
continuous-integration/drone Build is passing
更新Git配置代理文档
2025-08-26 23:45:41 +08:00

41 lines
832 B
Markdown

> 本文作者:丁辉
# Git配置本地代理
> 本地启动代理后,使用命令更改端口
## 配置代理
- 全局代理
```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 --global --unset http.proxy
git config --global --unset https.proxy
```