AndreaNobili AndreaNobili - 1 year ago 64
Git Question

Why I can't clone this GitHub repository when I am under a proxy?

I am pretty new in GIT and GitHub and I think I have some configuration problem.

Yesterday I have correctly configurd the SSH connection between my local GIT and my GitHub account. It works fine.

Today I go to the office where I am under a proxy and using the same laptop I try to clone a remote repository (on my GitHub account) to my local repository.

The proxy is correctly setted on my GIT, infact doing:

$ git config --global http.proxy

That is the same proxy that I use to navigate on Internet that I have setted into the browser settings.

The problem is that when I try to clone my repository on GitHub into my local repository I obtain this error message:

$ git clone
Cloning into 'recipes'...
ssh: connect to host port 22: Connection timed out
fatal: Could not read from remote repository.

If I connect to Internet using my smartphone connection (that is not under proxy) it works fine.

Why? What am I missing?


Answer Source

Although you've configured an http proxy, you haven't instructed Git to use http - you've specified that it should use ssh to connect:

$ git clone

And indeed, your error message is that ssh timed out:

ssh: connect to host port 22: Connection timed out

This happens because you have a firewall blocking your connection. Instead, specify the repository as an HTTP URL, and Git will use the corporate proxy you've configured:

$ git clone
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download