git clone can't resolve proxy

When I try to clone from git

git clone "http://github.com/symfony/symfony.git" "d:/www/a/vendor/symfony"

I get an error

Cloning into 'd:/www/a/vendor/symfony'...
error: Couldn't resolve proxy '(null)' while accessing http://github.com/symfony/symfony.git/info/refs
fatal: HTTP request failed

I'm connected directly to the internet (without proxy). I tried to turn off firewall and didn't help. I'm on windows and just installed Git-1.7.10-preview20120409.exe from http://code.google.com/p/msysgit/downloads/list . Previously I had 1.7.8 and this command worked. I also reinstalled TortoiseGit but I think it doesn't matter.

My C:\Documents and Settings\xxx\.gitconfig file is

[http]
    proxy = 
[user]
    name = xxxx
    email = [email protected]

Solution 1:

Seems the problem is reported in the mailing list. Does this help?

git config --global --unset http.proxy

Solution 2:

I just got the same issue, when pushing behind a firewall.

The problem wasn't an empty http_proxy var (git var -l didn't show any proxy variable), and my OS environment variables included:

http_proxy=username:[email protected]:port
https_proxy=username:[email protected]:port
no_proxy=.company

This setting would always trigger a:

error: Couldn't resolve proxy '(null)' while accessing https://...

However, as soon I changed the proxy variables, adding an 'http://' in front of the proxy addresses, the error message stopped:

http_proxy=http://username:[email protected]:port
https_proxy=http://username:[email protected]:port
no_proxy=.company

(note the 'http://' even for the https proxy address)

Solution 3:

Run the below command in git bash

git config --global --unset http.proxy

Note: Don't forget to restart the git bash, otherwise it won't work.

Also make sure to remove HTTPS_PROXY and HTTP_PROXY environment variables.


If the above steps didn't work for you, try setting your companies proxy as shown below;

git config --global  http://example.com:8080
git config --global  https://example.com:8080

**change example.com/8080 with your companies proxy and port

Solution 4:

Just delete the

 [http]
     proxy =

worked for me