LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to access a git repository from behind a proxy (which requires authentication) (http://www.linuxquestions.org/questions/linux-software-2/how-to-access-a-git-repository-from-behind-a-proxy-which-requires-authentication-435107/)

anupamsr 04-14-2006 10:21 AM

How to access a git repository from behind a proxy (which requires authentication)
 
I want to access a git repository from behind a proxy (which requires authentication). How to do so?

noteventime 04-14-2006 07:39 PM

I don't know about git but to specify a proxy with authentication you use (protocol://username:password@adress:port) eg http://admin:root123@192.168.0.5:8080

anupamsr 04-14-2006 09:21 PM

Sorry, but I want to run git specifically. I have already specified http_proxy variable

ameyp 03-18-2009 09:04 PM

[Solved]
 
I found the instructions on some page.
I've pasted them here for easier access.

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=<PATH TO YOUR SCRIPT>/proxy-cmd.sh

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

Cheers :)

ameyp 03-21-2009 04:52 PM

Doesn't work
 
When I try this, I get the following error:

Connection Refused: Forbidden
git.worldforge.org[0: 85.214.62.124]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

Please help :(

maheshkk 07-28-2010 08:49 AM

@ameyp your suggestion worked like champ! Thanks!

Note to others: ameyp suggestion works only for git_:_// scheme urls.

Any solution for http_:_// scheme as well?

WUAmin 01-16-2012 08:45 AM

This worked for me !

Set proxy :
Code:

$ git config --global http.proxy http://myproxy.domain.com:1234
Check proxy :
Code:

$ git config --get http.proxy
i found it in here.


All times are GMT -5. The time now is 04:44 PM.