I am trying to build a rails project and because the host I am working on doesn't have access to the Internet for the the git:// protocol (port 9418) I get errors like
fatal: unable to connect to github.com:
github.com[0: 126.96.36.199]: errno=Connection refused
gem 'jasmine', :github => 'pivotal/jasmine-gem'
Git provides URL rewriting functionality using the url..insteadOf configuration option.
So to make all connections to github.com use https:// rather than git://
git config --global url."https://github.com".insteadOf git://github.com
--global switch sets the config option for all git operations by the current user, so there are times where it may be too intrusive. But it does avoid changing the git config in the current project.