git clone works; git submodule fails “Permission denied”

Git tries to clone the submodule using ssh and not https.
If you haven’t configured your ssh key this will fail.
You can setup ssh-agent to cache the password for the ssh key and get git to use that. Or change to https.
Git is a bit confusing regarding submodules. They are configured in the .gitmodules file in the directory, but changing the url here from ssh to https won’t help. Git uses the url that is configured in .git/config.
Open this file and you will find something like this.

[submodule "project-submodule"]
    url = [email protected]:project-submodule.git

Change this url to the https equivalent and try again.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)