Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No, it is not a good idea to add the same submodule multiple times as a submodule of a submodule in Git.

Git submodules are designed to allow you to incorporate one Git repository into another as a subdirectory. However, adding the same submodule multiple times as a submodule of a submodule can lead to several problems, including:

  1. Increased complexity: It can make the repository more difficult to understand and maintain, as it creates unnecessary levels of nested submodules.

  2. Conflicts: If the same submodule is added multiple times with different versions or configurations, it can lead to conflicts and inconsistencies.

  3. Unnecessary duplication: Adding the same submodule multiple times can result in unnecessary duplication of files, leading to larger repository size and slower performance.

Therefore, it is generally recommended to avoid adding the same submodule multiple times as a submodule of a submodule and instead use a single instance of the submodule at the appropriate level in the repository hierarchy.