为 git设置代理

时间:2023-03-08 21:01:59

普通设置

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

git config --global --unset http.proxy git config --global --unset https.proxy

针对 ssh 的方式。比如 git clone git@github.com:lemos1235/TamakosBot.git

1.安装 proxychains:

yaourt -S proxychains

2.修改 /etc/proxychains.conf 文件:

注释掉下面的两行

proxy_dns

socks4 127.0.0.1 9050

末尾添加一行

socks5 127.0.0.1 1080

3.使用方法

proxychains git clone git@github.com:lemos1235/TamakosBot.git