Force bundle install to use https:// instead of git:// for GitHub-based gems

前端 未结 7 1362
长发绾君心
长发绾君心 2020-12-24 04:49

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

7条回答
  •  北海茫月
    2020-12-24 05:43

    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
    

    The --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.

提交回复
热议问题