Trying to load files from github through a firewall is impossibly slow. Any suggestions for workarounds?

StackOverflow https://stackoverflow.com/questions/88476

  •  01-07-2019
  •  | 
  •  

Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

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/

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

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

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

Done!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top