通过http代理git

根据git服务器URL的不同分为两种情况

使用HTTP地址

git repo地址形如http://github.com/yegle/twip.githttps://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。这种情况下需要搭配OpenSSHProxyCommmand使用

  1. 这里下载connect.c。这是一个简单的C写的代理程序。编译之
  2. 修改~/.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 !

blogroll

social