We have a somewhat larger project that is organised in various interdependent git repositories following a tree structure without recursion. In what follows I try to depict the smallest possible example that would highlight the problem I'm trying to address, even if in our case the tree depth can be relatively big. Suppose the system of repositories and submodule dependencies as follows (notation "->" means uses as a submodule):
A
B -> A
C -> A, B
If I use git clone --recursive for C, the following directory structure will happen:
C/
C/A
C/B/A
This repetition will also happen inside the .git directory: you'll find .git/modules/A, .git/modules/B, and .git/modules/B/modules/A. While I understand the reasons for this, in our particular case, it would be useful if the structure would be more like the following (notation: "->" symlink):
C/A
C/B
C/B/A -> C/A
So, if I would update A inside B, it would also be updated in C, and I'd just have to commit the changes to those repos and they would stay in sync. Is this possible somehow within git? Are there practical solutions to this issue?