2010年11月7日星期日

Set Git Proxy


## Set a proxy for curl
$ export http_proxy="http://proxy.bupt.edu.cn:8080"
## Get the connect.c file and compile it
$ curl http://www.meadowy.org/~gotoh/ssh/connect.c > connect.c
$ gcc -o connect connect.c
## Write a bash file
$ cd ~/bin
$ vi http-proxy
    #!/bin/sh
    # FileName: http-proxy
    # This connects to an HTTP Proxy using connect.c
    connect -H http://proxy.bupt.edu.cn:8080 $@
$ chmod a+x http-proxy
## Run git config and you should change the name "kernel.org" to your interest site.
$ git config --global core.gitproxy "http-proxy for kernel.org"
## If your proxy needs an auth, write rc file for connect.
$ vi /etc/connectrc
    HTTP_PROXY_USER=useraccount
    HTTP_PROXY_PASSWORD=passwd

没有评论: