1

I use the below way to set the proxy in my linux machine.

export HTTP_PROXY=http://proxy.xxxxxx.com
git config --global http.proxy $HTTP_PROXY

But the below error still happened.

[root@xxxxxxx cnpm]#  git clone git://github.com/cnpm/cnpmjs.org ./cnpmjs.org
Cloning into './cnpmjs.org'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.129]: errno=Connection timed out

ps: In our company, IE proxy is set using http://proxy.xxxxxx.com, and I can download the git project in IE manually.

liam xu
  • 2,892
  • 10
  • 42
  • 65

1 Answers1

1

http_proxy is only valid for http url, not git url.

The git protocol is a special daemon that comes packaged with Git; it listens on a dedicated port (9418) that provides a service similar to the SSH protocol, but with absolutely no authentication

It is not concerned with http_proxy environment variable.

For GitHub http url environment settings, see:

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks. But I really use the git config --global http.proxy $HTTP_PROXY except for the http_proxy – liam xu Oct 08 '15 at 02:43
  • @liamxu the git config does not matter here as long as you are using a git url. The http setting will be ignored. – VonC Oct 08 '15 at 04:33