216

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
0

5 Answers 5

401

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
Sign up to request clarification or add additional context in comments.

8 Comments

thanks it helped me too. I just updated url line inside .git > config ==> to https ://[email protected]
worked for me but had to disable 2 factor auth when cloning from private organization repo
Any advice on what to do if HTTPS is getting timed out as well?
@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.
If the issue occurred during either npm or yarn install, change the default requesting protocol from git:// to https:// by running, git config --global url."https://".insteadOf git:// Also, you can revert this change later by running, git config --global url."git://".insteadOf https://
|
380

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?

5 Comments

thanks man. i was also hving same issue while work from office internet. which doesnt allow SSH url.
Is there a way to make this work only for domain github.com?
git config --global url."https://github.com".insteadOf git://github.com
i would mark this as the perfect answer, for those are using repo/yocto way
This can also be undone in ~/.gitconfig if you only want to apply it temporarily.
31

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

3 Comments

what proxy_username??
To use the default proxy credentials, use the following commands: git config --global http.proxy http://:@proxy_ip:port and git config --global https.proxy https://:@proxy_ip:port
The below commands also work for me. git config --global http.proxy proxy_ip:port git config --global https.proxy proxy_ip:port
17

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.

1 Comment

if 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.
0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.