Unable to Connect to GitHub.com For Cloning
Solution 1
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
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
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
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.
Related videos on Youtube
Mohamed Hussain
Senior Front End Developer, creating fast loading high performance RWD Web Pages, Learning and sharing what I learned. Love to avoid costly heavy frameworks and using vanilla JS , HTML, CSS alternatives when possible. Good in vanilla JS, CSS, HTML, PWA Features, jQuery, Angular 1.x , CSS frameworks Foundation, bootstrap.
Updated on September 01, 2021Comments
-
Mohamed Hussain over 2 years
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
-
laurent about 11 yearsWhat does
ping github.com
gives you? -
Mohamed Hussain about 11 years@Laurent This is the one i got:Pinging github.com [204.232.175.90] with 32 bytes of data:
-
Mohamed Hussain about 11 years@Laurent Pinging github.com [204.232.175.90] with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 204.232.175.90: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
-
Chronial about 11 yearsAre you behind a firewall?
-
Chronial about 11 yearsTry this command:
git clone https://github.com/angular/angular-phonecat.git
(using https) -
Mohamed Hussain about 11 years@Chronical yes i guess.. how to know i am behind the firewall. Please help me to find this.
-
Mohamed Hussain about 11 years@Chronial After using the https:// as u suggested i am able to clone the repository. thanks a lot. You saved my day. put the answer in answer's section.
-
Vahap Gencdal about 8 yearsYou can find answer from this post stackoverflow.com/questions/21789683/how-to-fix-bower-ecmderr
-
Vahap Gencdal about 8 yearsyou can find answer from this post stackoverflow.com/questions/21789683/how-to-fix-bower-ecmderr
-
zypro about 4 yearsI'm facing this issue only sometimes but from different servers im cloning on. Sometimes a rerun works, sometimes I have to try it multiple times... So in the same time 2 Server can clone the repo while another can't.
-
-
Achyut about 10 yearsCan you share something similar for Windows
-
STEEL almost 10 yearsthanks it helped me too. I just updated url line inside .git > config ==> to https ://[email protected]
-
STEEL almost 10 yearsthanks man. i was also hving same issue while work from office internet. which doesnt allow SSH url.
-
lfender6445 over 9 yearsworked for me but had to disable 2 factor auth when cloning from private organization repo
-
gjw80 over 9 yearsAny advice on what to do if HTTPS is getting timed out as well?
-
androidevil over 9 yearsyour answer is the same as Chronial, that is the answer checked as right for this question.
-
Gavin over 8 yearsIs there a way to make this work only for domain github.com?
-
fulvio about 8 years@STEEL Thanks for pointing me in the right direction. I had tried all of those
insteadOf
commands multiple times with different options and noticed that my~/.git_config
was messed up. I removed all of them, disabled my Mac OSX Firewall and now everything works. -
sclausen almost 8 yearsUnfortunately this won't work if a dependency has dependencies with "angular/angular-phonecat".
-
Javier Abrego about 7 years
git config --global url."https://github.com".insteadOf git://github.com
-
KansaiRobot over 6 yearswhat proxy_username??
-
thurt about 6 yearsif you are already using https:// and still having issues, try this answer. i just had to add a 9418 port trigger on my router and it worked.
-
Louis 'LYRO' Dupont about 5 yearsTo use the default proxy credentials, use the following commands:
git config --global http.proxy http://:@proxy_ip:port
andgit config --global https.proxy https://:@proxy_ip:port
-
zappy about 5 yearsi would mark this as the perfect answer, for those are using repo/yocto way
-
GDP2 over 4 yearsThis can also be undone in
~/.gitconfig
if you only want to apply it temporarily. -
Prometheus over 4 yearsThe below commands also work for me. git config --global http.proxy proxy_ip:port git config --global https.proxy proxy_ip:port
-
Amit Singh almost 2 yearsThanks https:// works for me looks like my system firewall blocks git:// scheme