22

I'm a little hesitant to post this, as I'm not completely sure what I'm doing. Any help would be wonderful.

I'm on a computer with a firewall/filter on it. I can download files without any difficulty. When I try to clone files from Github, though, the computer just hangs. Nothing happens. It creates a git file in the folder, but the key files don't get loaded in. For context, I'm working on a Rails app, trying to load in Restful Authentication.

Have any of you dealt with this? Any suggestions for getting the clone to work? Disabling the firewall might be an option, but if I can do something without going through that process, I'd appreciate it.

charliepark
  • 1,480
  • 2
  • 13
  • 15

6 Answers6

24

Github supports cloning using both the git protocol over port 9418 and HTTP over port 80. Using the later is very slow (Reference). You should open port 9418 on your firewall or use HTTP cloning otherwise.

zvikara
  • 1,597
  • 3
  • 13
  • 19
  • It seems github redirects http to https (port 443) so plain HTTP cloning is no longer possible - opening up port 443 or 9418 is now the only option. – Greg Nov 09 '11 at 03:41
  • 1
    @Greg Does it mean that port 9418 open would result in a fully functional GitHub client? – László Jan 20 '14 at 11:41
18

Or... just change the "git://" prefix to "http://"

Eric Kramer
  • 192
  • 2
  • 7
6

If you're firewalled out of existence and want the speed of git [update: HTTP(S) is practically as fast as ssh these days, but this information is still useful if SSH is the only way to access a repo], and have ssh access to a machine that isn't firewalled, then use an ssh tunnel.

To do so, run this in one window, and leave it running:

$ ssh username@some_host_not_firewalled -L9418:github.com:9418

Then wherever you used the former command:

$ git clone git://github.com/jruby/jruby.git

use this instead:

$ git clone git://localhost/jruby/jruby.git

This translation can be done automatically if you modify your (global) git config:

$ git config --global url.git://localhost/.insteadOf git://github.com/
Community
  • 1
  • 1
rogerdpack
  • 62,887
  • 36
  • 269
  • 388
4

The git:// protocol uses port 9418, so you should make sure your firewall allows outbound connections to this port.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
1

I'm use git clone git@ssh.github.com:xxx.user/xxx.proj

ken
  • 13,869
  • 6
  • 42
  • 36
0
git config --global url."https://".insteadOf git://

Done!