Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 587
Debajit Avatar asked Apr 23 '09 22:04

Debajit


People also ask

How do I git behind a proxy?

Setting the proxy for Git Run the following commands replacing USERNAME , PASSWORD , PROXY_ADDRESS , and PROXY_PORT with your network's information: git config --global --add http. proxy http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT. git config --global --add https.

Does GIT use Http_proxy?

Now whenever you do anything with [email protected] , it will use the proxy automatically.

How do I permanently set a proxy in Linux?

Set up proxy permanently using /etc/profile.Replace http_proxy with https_proxy in the export argument to enable proxy over SSL/TLS. This information will be provided by the Network Team who have provided the proxy server related details.


2 Answers

Command to use:

git config --global http.proxy http://proxyuser:[email protected]:8080 
  • change proxyuser to your proxy user
  • change proxypwd to your proxy password
  • change proxy.server.com to the URL of your proxy server
  • change 8080 to the proxy port configured on your proxy server

Note that this works for both http and https repos.

If you decide at any time to reset this proxy and work without proxy:

Command to use:

git config --global --unset http.proxy 

Finally, to check the currently set proxy:

git config --global --get http.proxy 
like image 51
Salim Hamidi Avatar answered Oct 12 '22 02:10

Salim Hamidi


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

I didnt 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:[email protected]:8080 $ git config --system http.sslcainfo /bin/curl-ca-bundle.crt $ git remote add origin https://mygithubuser:[email protected]/repoUser/repoName.git $ git push origin master 

proxyuser= the proxy user I was assigned by our IT dept, 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 repo

repoName = the name of the repo

like image 41
alvaro Avatar answered Oct 12 '22 01:10

alvaro