This error can also be presented as:
No submodule mapping found in .gitmodule
This error occurs when you are using Git submodules in your repo, but no mapping reference exists in the parent repository for a submodule. The mapping reference needs to be added to a `.gitmodules` file located in the root of the project repo.
Submodule Mapping
The contents of the `.gitmodules` file should look something like the below:
โ
[submodule "path/to/submodule"] path = path/to/submodule url = git://url-of-submodule-repo/
You will need to replace `path/to/submodule` with the relative path of the submodule in your repository.
The `url-of-submodule-repo` should be replaced with the URL of the repository that contains your submodule's files.
Submodule Authorization
If your submodule exists in a private repository that Servd does not have access to you will need to add a deploy key to the submodule. If you have used a manual repo connection when setting up your Servd project, this deploy key will be the same as the one that you used to connect the main project repo.
If you haven't had to use the deploy key for your project you can find it by visiting the 'Project Settings' page within the Servd dashboard.
GitHub Deploy Tokens
GitHub prevents the same deploy token from being associated with multiple repos. If both your parent and submodule repos will be using deploy keys and they are both hosted on GitHub you will need to use a workaround by creating a machine user, assigning the deployment key to that user and then adding the user to both projects.
You can read more about that in GitHub's documentation.