I\'m trying to use Git through a proxy. I\'ve tried setting parameters \'git config --global\' in a lot of ways but always without success when cloning repositories.
Note that for any Git between 2.8 (February 2016, five years after the OP's question) and Git 2.13 (Q2 2017), an invalid proxy configuration would be silently ignored (not even a 407)
See commit ae51d91, commit 5741508 (11 Apr 2017) by Sergey Ryazanov (acteek).
Helped-by: Jeff King (peff).
(Merged by Junio C Hamano -- gitster -- in commit 6b51cb6, 24 Apr 2017)
http: fix the silent ignoring of proxy misconfiguraion
Earlier, the whole
http.proxyoption string was passed tocurlwithout any preprocessing socurlcould complain about the invalid proxy configuration.After the commit 372370f ("
http: use credential API to handle proxy authentication", 2016-01-26), if the user specified an invalid HTTP proxy option in the configuration, then the option parsing silently fails and NULL will be passed to curl as a proxy.
This forcescurlto fall back to detecting the proxy configuration from the environment, causing thehttp.proxyoption ignoring.Fix this issue by checking the proxy option parsing result. If parsing failed then print an error message and die.
Such behaviour allows the user to quickly figure the proxy misconfiguration and correct it.