Alex Rivera | Logout

Getting Git to work with a proxy server - fails with "Request timed out"

Asked 2009-04-23T22:32:53.877
1044

How do I get Git to use a proxy server?

I need to check out code from a Git server, but it shows "Request timed out" every time. How do I get around this?

Alternatively, how can I set a proxy server?

Edit
Report

1 Answer

142

This worked for me, in Windows XP behind a corporate firewall.

I didn’t have to install any local proxy or any other software besides git v1.771 from http://code.google.com/p/msysgit/downloads/list?can=3

git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --system http.sslcainfo /bin/curl-ca-bundle.crt
git remote add origin https://mygithubuser:mygithubpwd@github.com/repoUser/repoName.git
git push origin master

proxyuser = the proxy user I was assigned by our IT department. In my case, it is the same Windows user I use to log in to my PC, the Active Directory user.

proxypwd = the password of my proxy user

proxy.server.com:8080 = the proxy name and port, I got it from Control Panel, Internet Options, Connections, LAN Settings button, Advanced button inside the Proxy Server section, use the servername and port on the first (http) row.

mygithubuser = the user I use to log in to github.com

mygithubpwd = the password for my github.com user

repoUser = the user owner of the repository

repoName = the name of the repository

answered 2011-11-23T20:14:38.647

Your Answer