The original .gitmodules file uses the hard coded https urls but for some automated tests I clone from ssh and make the submodule urls
I tried the above solution but had a mess of problems for some reason. The following is an alternative.
In a new repository:
git submodule initgit clone ../local/path/to/submodule.git path/in/repo/submoduleWhenever the root repository submodule hashes change and you need to sync the submodules:
git submodule update with maybe --force and --recursive for good measure