【linux】git使用ssh通道代理访问仓库

 在国内访问github真的很慢,原因你懂的。通过ssh代理来提高访问速度的前提是防火墙外要有一个做代理的主机才可行。

1 https代理设置

1.1 git客户端配置
1
2
git config --global https.proxy https://127.0.0.1:<port>
git config --global https.proxy http://127.0.0.1:<port>

撤消:

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

1.2 ssh转发配置
1
ssh -N -D 127.0.0.1:<port> <user>@<romote host>

:端口同上

1.3 使用

  正常使用git clone https://github.com/<user>/<rep>就行。

还有socks5方式和ssh方式,等我需要用的时候再来总结。拜拜!!!

坚持原创技术分享,您的支持将鼓励我继续创作!
0%