Let's assume you have the proper access rights, the ssh key is working for normal repositories but not for submodules (as it was the case for me).
We added the submodules as relative path. As described here
So the .gitignore
looks like this:
[submodule "example_json_client"]
path = example_json_client
url = ../example_json_client.git
This would imply that git use the same authentication method for the submodules as for the super repo. Note, if you changed from absolute url to relative, you might need to deinit
and remove
the submodule to take effect.
But! If your git config has a credential entry, it might fall back to HTTPS. To check it, execute
git config --global --list
Then look for an entry like (for me it is bitbucket, but there could be other provider, like github or gitlab, etc.),
credential.https:/bitbucket.mycompany.net.provider=bitbucket
Finally, if you remove that entry from the config, the submodule update with the proper authentication method should work.