一、针对 http

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

方法一:使用 proxychains 将 ssh 转换成 http

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

方法二:配置 .ssh/config

Host github.com
User git
ProxyCommand nc -x localhost:7890 %h %p

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-01-09
  • 2022-02-26
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2022-02-16
  • 2021-11-27
  • 2021-12-23
相关资源
相似解决方案