2026-04-02 23:12:36 +08:00

29 lines
636 B
Markdown

---
title: git走代理
createTime: 2022/11/03 16:08:24
tags:
- git
categories:
- 随记
---
## 临时代理
```bash
git -c http.proxy=127.0.0.1:1080 clone http://xxxxxxx
```
## 永久代理
```bash
# socks
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
# http
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://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
```