Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I cannot check out both code.google.com and github projects via git, but I can normally access them from IE/Firefox browser. There were a lot of discussions about git proxy configuration behind firewall but unfortunately none of these discussions is suitable for my problem.

Here are the messages while I am trying to access code.google.com

Cloning into 'smart-adaptive-makefile'...
* Couldn't find host code.google.com in the .netrc file; using defaults
* About to connect() to proxy proxyconf port 1080 (#0)
*   Trying 147.243.224.17...
* 0x80077208 is at send pipe head!
* STATE: CONNECT => WAITCONNECT handle 0x8007fba0; (connection #0)
* Connection timed out after 300015 milliseconds
* STATE: WAITCONNECT => COMPLETED handle 0x8007fba0; (connection #-5000)
* STATE: COMPLETED => MSGSENT handle 0x8007fba0; (connection #-5000)
* Closing connection #0
* Couldn't find host code.google.com in the .netrc file; using defaults
* About to connect() to proxy proxyconf port 1080 (#0)
*   Trying 147.243.224.17...
* 0x80077208 is at send pipe head!
* STATE: CONNECT => WAITCONNECT handle 0x8007fad8; (connection #0)
* Connection timed out after 300032 milliseconds
* STATE: WAITCONNECT => COMPLETED handle 0x8007fad8; (connection #-5000)
* STATE: COMPLETED => MSGSENT handle 0x8007fad8; (connection #-5000)
* Closing connection #0
error: Connection timed out after 300032 milliseconds while accessing https://panruochen@code.google.com/p/smart-adaptive-makefile/info/refs
fatal: HTTP request failed

BTW, my IE/Firefox uses an automatic configuration script instead of manually configuration proxy server. In this case, how should I configure git?

BR,ruochen

share|improve this question

migrated from stackoverflow.com Oct 18 '12 at 8:41

This question came from our site for professional and enthusiast programmers.

    
are you accessing git repository using https or git protocol? –  Habibillah Oct 18 '12 at 2:57
    
I access git repository via https –  PRC Oct 18 '12 at 3:28
add comment

1 Answer

I manage to access any external repo behind firewall without any issue, provided I have my proxy settings in place:

HTTPS_PROXY=http://username:password@proxy.server:port
HTTP_PROXY=http://username:password@proxy.server:port 

Note that both addresses the same proxy address (in my case, an http, not https one), with the username and password for that proxy (not for GitHub)

~/.netrc (or %HOME%/_netrc on Windows, if you defined explicitly an %HOME% environment variable) is only used for the external repo authentication:

machine github.com
login user
password passwd

See "Git - How to use .netrc file on windows to save user and password" for more.

share|improve this answer
    
Basically your solution works. Simply setting http.proxy in git is okay. It is not necessary to setting HTTP_PROXY/HTTPS_PROXY environment variables. I got the problem because I used to set http.proxy directly to the automatic configuration script which was copied from the browser setting. Now I open that script and manually pick up the proxy server address and set it to git and solve the problem. –  PRC Oct 18 '12 at 7:32
    
@PRC true, but I need those for other programs to work, and I prefer don't leave my username / password in git config files. I define those variable in a DOS session each time I need them. –  VonC Oct 18 '12 at 7:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.