I am currently working on a project comprising multiple sub-projects. Each sub-project, in turn, consists of multiple components, which might be shared by two or more sub-projects.
Let's say, for example, that there are the following components:
- component A
- component B
- component C
- component D
Each component has its own git repository and carries out a very well-defined task.
Then, there are the following sub-projects:
- sub-project A, consisting of components A, B and C
- sub-project B, consisting of components A, B and D
Sub-projects are independent from one another but, like in this example, can share components with other sub-projects. Also, both components and sub-projects will have their own versions (eg. sub-project A v1.5 comprises component A v2.3, component B v1.6 and component C v1.9).
Now the question is, what would be the best way to manage this scenario using git as version-control system? I thought that I could add the components to the sub-projects' repositories as submodules, but, having read that the use of submodules in git is usually discouraged, I wondered if there were better ways to accomplish the goal.
Edit: my question differs from this one because the latter appears very specific to Vagrant, a software that I do not plan to use.