I have a Git project. Let's name that Proj.
Proj has two submodules, Lib and Utils.
Lib also has the submodule Utils.
Now the problem is, when one wants to git clone --recursive Proj, he will need to download Utils twice. When the project grows deeper, the situation may be worse.
So how can I make Proj reuse the Utils already downloaded by Lib?
My working tree:
Proj # Main project
+-- .git
`-- external
+-- Lib # Proj depends on Lib
| +-- .git
| `-- external
| `-- Utils # Lib depends on Utils
| `-- .git
`-- Utils # Proj also depends on Utils
`-- .git
Note:
It is better that
Utilsstays atexternal/Utils.Due to Windows compatibility, symlinks are not allowed.
I will appreciate it if anyone can help me with such a complicated question.