Answers
Here are the answers to the questions given above:
- With subtree merging, the history of the subproject (or its summary) is included in the superproject repository, and subproject files are put directly in a subirectory of the superproject and are superproject files. Subtrees can be used only for required dependencies, as they are embedded in a superproject. They are simpler to understand and use.
- With submodules, repositories and the histories of superproject and subproject are kept separate. A superproject includes a link to the commit in a subproject. Submodules can be initialized and active, but can also be kept inactive, thus they can be used for optional dependencies. To include a change, you need to make a change in a subproject and to include it in a commit in a superproject.
- The information in the project configuration file about submodules is local to the repository and, among others, defines which submodules are active and which are not.