This article is about Codeship Basic.

Git Submodules

Estimated Reading Time: 1 min

If your repository includes a .gitmodules file Codeship will automatically initialize and update the configured submodules. To do this, we run the following command after cloning your repository.

git submodule update --recursive --init

For submodules that are hosted as public repositories that should just work (and let us know if it doesn’t).

If your submodule is however a private repository you’d need to make sure Codeship can clone the repository.

  1. Make sure the project’s public SSH key (from the General settings page) has access to the submodule repository. See how to provide access to other repositories if you’re not sure how to achieve this.
  2. Make sure the submodule is referenced via a SSH based URL (e.g. git@github.com:codeship/documentation.git). If you reference the submodule via a HTTPS based URL (e.g. https://github.com/codeship/documentation.git), the git client will ask for authentication credentials during the build and run into a timeout (as you can’t provide them).

See the git documentation on Git Submodules for more information on working with submodules.