在国内访问github真的很慢,原因你懂的。通过ssh代理来提高访问速度的前提是防火墙外要有一个做代理的主机才可行。
1 https代理设置
1.1 git客户端配置
1 | git config --global https.proxy https://127.0.0.1:<port> |
注 撤消:
1 | git config --global --unset https.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方式,等我需要用的时候再来总结。拜拜!!!