I have a library that relies on a number of other components. I've setup the main project and then added a number of submodules using git submodule add [url] [path].
The original project works fine. Each time I added a submodule it was cloned to the correct directory.
- Main project
-- Sub project [cloned correctly]
After that I pushed the original project to git. Now when I clone the main project, the sub project directories appear but they're empty.
- Main project
-- Sub project just empty folder
The .gitmodules is populated correctly but in the newly cloned main project, the .git/modules folder is empty.
No commands like git submodule sync or git submodule update work. However, if I manually re-add the modules they then appear in the directories without having to be re-downloaded. It says:
Reactivating local git directory for submodule
It's almost like git has the modules stored internally but doesn't add them to the file system.
What's the best practice for a situation like this?