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?
2022-05-17
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?
The command to use:
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
proxyuser to your proxy userproxypwd to your proxy passwordproxy.server.com to the URL of your proxy server8080 to the proxy port configured on your proxy serverNote 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