Unable to Connect to GitHub.com For Cloning

允我心安 提交于 2019-11-26 08:43:00

问题


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

回答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



回答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?




回答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



回答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.




回答5:


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

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


来源:https://stackoverflow.com/questions/16298986/unable-to-connect-to-github-com-for-cloning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!