Getting Git to work with a proxy server - fails with "Request timed out"
git, proxy, version-control
Solution
The command to use:
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com: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 repositories.
If you decide at any time to reset this proxy and work without proxy:
The command to use:
git config --global --unset http.proxy
Finally, to check the currently-set proxy:
git config --global --get http.proxy
Problem
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?
Related problems
- git:// through proxy
- Only use a proxy for certain git urls/domains?
- Using Git on Windows, behind an HTTP proxy, without storing proxy password on disk
- URL Encoding using C#
- Using a socks proxy with git for the http transport
- How to contribute on github anonymously via Tor?
- How do I pull from a Git repository through an HTTP proxy?
- Error "Failed to connect to github.com port 443"