Ask Your Question
1

Git: Is it a good Idea to add the same Submodule multiple times as Submodule a Submodule?

asked 2023-04-05 09:00:15 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-05 09:01:37 +0000

qstack gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

1 follower

Stats

Asked: 2023-04-05 09:00:15 +0000

Seen: 517 times

Last updated: Apr 05 '23