Git error: fatal: unable to connect a socket (Invalid argument) Git error: fatal: unable to connect a socket (Invalid argument) windows windows

Git error: fatal: unable to connect a socket (Invalid argument)


I had the exact same error; but the ~/.gitconfig global config file was the key.

If you have a proxy with authentication you need to put in it:

git config --global http.proxy http://login:password@our-proxy-server:8088

And it just works (with 'git clone http:')

Example of a blog detailing the same setup: GIT clone over HTTP: who knew?


If it still fails in 407, it could be related to a problem with git-fetch losing authentication tokens on the second HTTP GET. A more recent version of libcurl might be needed.


Update January 2011: jbustamovej mentions in his answer (upvoted) his blog post "GitHub Behind Corporate Proxy", which adds this:

It’s important to note that if your login has a backslash, as in domain\login, you must escape the backslash, as in:

git config --global http.proxy http://domain\\\login:password@our-proxy-server:8088


Even after configuring the proxy, you might be unable to connect, since the proxy is disallowing git protocol traffic. In this case, you might want to try using "http" instead of "git"

H:>git clone http://github.com/akitaonrails/vimfiles.git

Also, if you are using an automated proxy config file (.pac), just open it in a text editor. It is quite a easy to following scripting language, with a bunch of conditions to re-direct to the most efficient proxy. Find the one that allows general purpose traffic (typically, the last configured proxy), and configure it as mentioned in the comment above.


Do you have SOCKS proxy? If you have, you caould try FreeCap to socksify your git connection. I've been using git this way for a while.

If not, still try FreeCap. IIRC it might be able to use http proxies, but I haven't tried that.

EDIT:I usualy socksify cmd.exe using FreeCap, and from then on (almost) all cmdline programs that I start from that session are socksified too. That's why I recommended Free Cap, since SocksCap (another alternative) doesn't work that way.

As for using http.proxy, it for some reason never worked for me with mingw version and my company http proxies.