mac下给git://协议设置代理Proxy

1

sudo vi ~/.socks5proxyssh

#!/bin/sh
ssh -o ProxyCommand="/Users/tian/.socks5proxywrapper %h %p" "$@"

2

sudo vi ~/.socks5proxywrapper

#!/bin/sh
connect -S 127.0.0.1:1080 "$@"  

3

chmod a+x ~/.socks5proxyssh  
chmod a+x ~/.socks5proxywrapper  

4

sudo vi ~/.gitconfig

[http]
    proxy = socks5://127.0.0.1:9742
    # http协议直接走ssh代理
[core]
    gitproxy = /Users/tian/.socks5proxywrapper
    # git协议通过wrapper走代理

5
connect 密码: b8x6

gcc connect.c -o connect  
cp connect /usr/local/bin