I want to clone a repository including its submodules.
I’ve learned about the --recursive option at this question, but this solution requires the submodule repositories to be accessible from the cloning host.
Is there some switch to clone the submodules directly from the accessible host?
There is a https proxy through which I can theoretically reach the submodules repos, but the cloning host doesn’t have the needed certificates installed. So finding a way to install a certain https certificate in user space might be a solution as well.
If the remote server (host1 in your comment) would have to execute a clone or fetch on your behalf, then no, you can’t do this.
However, since the submodules are themselves repositories, you could use them directly if they are cloned on host1. After you clone the main repository, edit the
.gitmodulesfile and change the Github URLs to the corresponding subdirectories of host1:mainrepo:changes to
You can then use the
git submodulescommands to work with them.(You’ll have to be careful though: don’t commit your changes to
.gitmodulesor push commits into the submodules on host1 unless you really mean to!)For your alternative question, check out the Git config settings
http.proxyandhttp.sslCert. You should be able to provide a certificate file directly using the latter, without having to “install” it in the system CA path.