Header

Git submodules - Unauthorized fatal: Could not read from remote repository

When attempting to run a deployment from a repository with Git submodules, you may run into one of the following errors:

Unauthorized fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

With a reference to an external submodule URL. This happens when you are referencing a submodule in your .gitmodules file in the main repository, but DeployHQ doesn't have access to be able to clone it.

To resolve this, you'll need to ensure that the DeployHQ project's public key has been added to the submodule repository's deployment keys.

We have documentation explaining this process for the main repository hosts below: