Search code examples
gitgithubgit-submodules

Using ssh vs https with github submodules


I would like to set up a public GitHub repo with submodules. GitHub offers two ways of connecting - https:... & git@... protocols. For the team working on the project, git@... is much easier to use because we all use proper ssh certificates. But for the casual user who is not a member of the team, https:... is the only option. The git submodules require a full URL.

How can we set up repository submodules so that both the developers and casual contributors can use the system equally well? Thanks!


Solution

  • Publish your submodules with https:// protocol but make all your developers to use ssh:// protocol. Git can substitute one protocol with the other on the fly:

    git config url."ssh://git@".insteadOf https://