28th Apr2015

Unable to connect to github.com using git://github.com

by Gyro

While installing boostrap-sass using bower, the server returned a weird error message.

Failed to execute "git ls-remote --tags --heads git://github.com/twbs/bootstrap-sass.git", exit code of #128 fatal: unable to connect to github.com: github.com[0: 192.30.252.130]: errno=Connection timed out

I was a bit confused as this was working perfectly fine on my localhost, after some searching I found out that "The native git protocol uses port 443 for the main repo and port 9418 for the submodules. If this port is firewalled on the network, recursive clone times out and fails.".

Git can use https:// instead of git://, so the solution is to set it to use https:// by default:

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

Enjoy :crazy:
Gyro

 

Sources:
https://github.com/lagadic/vision_visp/issues/13
https://github.com/angular/angular-phonecat/issues/141

 

Similar error messages:

  • fatal: unable to connect to github.com:
    github.com[0: 192.30.252.131]: errno=Connection timed out
    Clone of ‘git://github.com/lagadic/visp_auto_tracker.git' into submodule path ‘visp_auto_tracker' failed
  • npm ERR! Error: Command failed: fatal: unable to connect to github.com:
    npm ERR! github.com[0: 192.30.252.130]: errno=Connection timed out
  • Failed to execute "git ls-remote --tags --heads git://github.com/twbs/bootstrap-sass.git", exit code of #128 fatal: unable to connect to github.com: github.com[0: 192.30.252.130]: errno=Connection timed out
    fatal: unable to connect to github.com:
    github.com[0: 192.30.252.130]: errno=Connection timed out

4903