Since someone is asking me to provide an English version about git proxy configuration in my former blog. Here it is. 1). Basically, I know two ways to use git behind a proxy.
- Set the http_proxy environment if git repository supports http connections.
find a proxy command to bypass the connection: connect.c
gcc -o connect connect.c
- Set up a wrapper
echo "/home/gigi/bin/connect -H proxy.bupt.edu.cn:8080 $@" >> ~/bin/proxy
Here I’m using a http proxy offered by my school, which uses port 8080 The connect command also support socket proxy. Use -S host:port to indicate that.
- Update bashrc
echo "export CONNECT_USER=bergwolf" >> .bashrc
The connect command reads proxy username and password from
CONNECT_PASSWORDevironment. The default username is current login user if no CONNECT_USER is set. Password will be requested interactively if CONNECT_PASSWORD is empty. GIT_PROXY_COMMAND indicates that git should use the command “proxy”(the wrapper we setup at step 2) as its proxy_command. This can also be set in .git/config.
Now, everything we need is done. Have a try:
[gigi-Ubuntu:bin]$git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git