How to clone private submodules

by bradrydzewski

Cloning private submodules may encounter the below error. This happens when a submodules uses git+ssh and requires a private rsa key for authorization.

Warning: Permanently added ',' (RSA)
to the list of known hosts.

ERROR: Repository not found.
fatal: Could not read from remote repository.

Example submodule configuration using git+ssh:

[submodule "hello-world"]
    path = hello-world
    url =

This can be mitigated by overriding the submodule url to use git+https:

    recursive: true
+   submodule_override:
+     hello-world:

The above example overrides the submodule url to force git+https. This configuration instructs git to use authorization credentials stored in an automatically created .netrc file.