Git submodules allow you to keep a Git repository as a subdirectory within another Git repository. Git submodules are helpful in maintaining a shared configuration file for your team, and then applying it to multiple Git repositories.
By default, Codacy does normal Git clones that don't include submodules to ensure that we only clone necessary repositories. However, if your organization needs to use submodules, please contact us at firstname.lastname@example.org asking to enable submodules on Codacy.
After we enabled submodules for your organization, do the following:
If you're using Codacy Self-hosted, you must update the license.
If your submodules are:
- Public repositories, make sure that your Git URL uses the HTTPS protocol
- Private repositories, make sure that your Git URL uses the SSH protocol.
If you already have repositories on Codacy where you want to use submodules, navigate to the page Settings and click the button Generate New User Key for each of these repositories.
If you're using Bitbucket Cloud, you must manually add the SSH key on your user account.
When you add a repository to Codacy, Codacy adds a new SSH key to your repository using an integration with your Git provider. Codacy uses this SSH key every time it needs to clone that repository. When you're using submodules, Codacy needs to clone additional repositories it has no access to. Since there is no way of identifying the submodules of a repository before cloning the repository, Codacy adds the SSH keys to the user account so that it has access to the same repositories as the user.
If you're using submodules to share an analysis tool configuration file across your repositories, check if your tool recursively searches the subdirectories of your repositories for configuration files.
If your tool doesn't detect the configuration files in the submodule directories, you must include a configuration file directly in the root of your repositories referencing the configuration files in the submodule directories.
Using submodules on new repositories#
You must repeat steps 2 to 4 above every time you add new repositories with submodules to Codacy.
Alternatively, you can make this the default behavior for all new repositories by enabling Add project key to the user, by default in Administration, page Settings.
If you're using Bitbucket Cloud this setting must be turned off since automatically adding the user keys isn't supported.
Share your feedback 📢
Did this page help you?
Thanks for the feedback! Is there anything else you'd like to tell us about this page?
255 characters left
We're sorry to hear that. Please let us know what we can improve:
255 characters left
Alternatively, you can create a more detailed issue on our GitHub repository.
Thanks for helping improve the Codacy documentation.
Edit this page on GitHub if you notice something wrong or missing.
If you have a question or need help please contact email@example.com.