Unable to Connect to GitHub.com For Cloning

GitGithubGit BashGit Clone

Git Problem Overview


I am trying to clone the angular-phonecat git repository, but I am getting the following message when I enter the command in my Git Bash:

$ git clone git://github.com/angular/angular-phonecat.git  
Cloning into 'angular-phonecat'...  
fatal: unable to connect to github.com:  
github.com[0: 204.232.175.90]: errno=No error

Git Solutions


Solution 1 - Git

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

Solution 2 - 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?

Solution 3 - Git

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

Solution 4 - Git

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.

Solution 5 - Git

I was having this problem but just realized that GitHub must be one of the sites my ISP's "child safe" filter blocks by default. Presumably there are some, er, adult code repositories out there. I added github.com to the Allow List on my ISP account page and all is working now. Might be worth checking if you have a similar filter in place.

Solution 6 - Git

You can try to clone using the HTTPS protocol. Terminal command:

git clone https://github.com/RestKit/RestKit.git

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMohamed HussainView Question on Stackoverflow
Solution 1 - GitChronialView Answer on Stackoverflow
Solution 2 - Gitbnguyen82View Answer on Stackoverflow
Solution 3 - Gitrneha725View Answer on Stackoverflow
Solution 4 - GitChris HalcrowView Answer on Stackoverflow
Solution 5 - GitStuart HoughtonView Answer on Stackoverflow
Solution 6 - GitDeepak SasindranView Answer on Stackoverflow