How to access a git repository from behind a proxy which requires authentication

by
Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0StumbleUpon0

Question : How to access a git repository from behind a proxy which requires authentication

Answer :

Basically the steps are:
1 - sudo apt-get install socket
2 – in your home directory, put a shell script called “proxy-cmd.sh”
containing (replace YOUR_PROXY and YOUR_PROXY_PORT with your own proxy
parameters):
#! /bin/bash
(echo “CONNECT $1:$2 HTTP/1.0″; echo; cat ) | socket YOUR_PROXY
YOUR_PROXY_PORT | (read a; read a; cat )
3 – chmod +x proxy-cmd.sh
4 – export GIT_PROXY_COMMAND= /proxy-cmd.sh

Note: you can export GIT_PROXY_COMMAND in your ~/.bashrc file to make
this permanent 

For questions please refer to our Q/A forum at : http://ask.unixmen.com/


Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0StumbleUpon0