根据git服务器URL的不同分为两种情况
使用HTTP地址
git repo地址形如http://github.com/yegle/twip.git或https://github.com/yegle/twip.git。这种情况下默认修改http_proxy环境变量即可。
export http_proxy="http://username:password@proxy-server.com:3128"
使用ssh地址
git repo地址形如git@github.com:yegle/twip.git。这种情况下需要搭配OpenSSH的ProxyCommmand使用
- 从这里下载
connect.c。这是一个简单的C写的代理程序。编译之 - 修改
~/.ssh/config,加入以下内容Host github.com ProxyCommand /path/to/connect -H proxy-server:3128 %h %p
使用git协议地址
git repo地址形如git://github.com/yegle/twip.git。使用socat。
参考这个gist:https://gist.github.com/49288
Comments !