0

Module A is our signalling system and is used in B and C separately and again in our main project for other things before adding B and C. Suppose the system of repositories and submodule dependencies as follows (notation "->" means uses as a submodule):

A
B -> A
C -> A
D -> C, B

If I use git clone --recursive for D, the following directory structure will happen:

D/
D/C/A
D/B/A

This repetition will also happen inside the .git directory: you'll find .git/modules/D, .git/modules/C, .git/modules/B/modules/A and .git/modules/C/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):

D/A
D/B
D/C
D/B/A -> D/A
D/C/A -> D/A

So, if I would update A inside one, it would also be updated in the other, 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?

P.S. I DID ssee this question as it does not have an answer I can use, hence I am asking again. Interestingly the situation described above is the one we are facing.

Hitarth Doctor
  • 126
  • 2
  • 7

0 Answers0