How to convert `git:` urls to `http:` urls

前端 未结 4 1667
轻奢々
轻奢々 2020-11-27 08:57

I\'m working behind an http proxy. I\'m trying to clone Android\'s source tree using their \"repo\" tool.

This tool insists on using git:// URLs, even

4条回答
  •  温柔的废话
    2020-11-27 09:49

    I had this same problem with recursively getting submodules in a git repository. I'm behind a crazy firewall that doesn't allow outgoing connections on the git port. Some of the submodules of the submodules were coded as git://github.com/blah/blah.git. This killed my recursive population of submodules. The workaround is the following:

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

    This replaces git:// with https://@ in all submodule repository URLs. You need to replace with your own git username. Also note that the --global is required; just adding this configuration to the base repository directory doesn't work.

提交回复
热议问题