0%

Git配置代理

HTTP/HTTPS

适用于http协议:git clone http://***.git

1
2
3
4
5
6
7
8
vim ~/.gitconfig

[http]
proxy = socks5://127.0.0.1:10820
proxy = http://127.0.0.1:10821
[https]
proxy = socks5://127.0.0.1:10820
proxy = https://127.0.0.1:10821

SSH协议

适用于ssh协议git clone git@***.git

1
2
3
4
5
6
vim ~/.ssh/config

Host github.com
IdentityFile "C:\Users\hatak\.ssh\id_ed25519"
ProxyCommand connect.exe -H 127.0.0.1:10821 %h %p
# -H后是http代理