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

前端 未结 19 2738
旧时难觅i
旧时难觅i 2020-11-22 05:09

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?

19条回答
  •  迷失自我
    2020-11-22 05:21

    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 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
    

提交回复
热议问题