Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Connect to GitHub.com For Cloning

People also ask

Why I Cannot clone a repository from GitHub?

If you're unable to clone a repository, check that: You can connect using HTTPS. For more information, see "HTTPS cloning errors." You have permission to access the repository you want to clone.

Why git clone is not working?

If you have a problem cloning a repository, or using it once it has been created, check the following: Ensure that the user has gone through initial GitCentric login and has the correct username, email, and ssh. This should return a usage message that refers to the config-branch, config-repo, and ls-repo commands.


You are probably behind a firewall. Try cloning via https – that has a higher chance of not being blocked:

git clone https://github.com/angular/angular-phonecat.git

You can make git replace the protocol for you

git config --global url."https://".insteadOf git://

See more at SO Bower install using only https?


I had the same error because I was using proxy. As the answer is given but in case you are using proxy then please set your proxy first using these commands:

git config --global http.proxy http://proxy_username:proxy_password@proxy_ip:port
git config --global https.proxy https://proxy_username:proxy_password@proxy_ip:port

Open port 9418 on your firewall - it's a custom port that Git uses to communicate on and it's often not open on a corporate or private firewall.