git:// protocol blocked by company, how can I get around that?

前端 未结 7 878
醉话见心
醉话见心 2020-11-28 00:26

Attempting something like git clone git://github.com/ry/node.git will not work, it results in:

Initialized empty Git repository in /home/robert/         


        
7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 00:31

    Github provides http(s) access too, which is much less likely to be blocked by your company. To tell the submodule to use that, you can do this:

    git submodule init
    git config submodule..url https://github.com/...
    git submodule update
    

    This is actually exactly why init and update are separate commands - you can init, customize locations, then update. update --init is just a shortcut for when you don'ot need to customize any URLs.

    For anyone else who happens across this, you could of course also use an ssh URL (if your company blocks git:// but not ssh), but in this case the OP presumably doesn't have SSH access to the remote repo.

提交回复
热议问题