Situation:
We have a project which consists of many submodules stored in app/modules folder. All submodules are independent and each group of users (developers) should work only with a specific subset of the submodules. This can be easily achieved by executing git submodule update --remote --merge app/modules/SomeModule
for specific submodules only (i.e. don't init/update all available submodules).
Question 1:
If some user does not need access to certain submodules, empty submodule folder will still exists. Is it possible to ensure that empty submodule folders don't exist by default and are created on request only (e.g. after init/update) ?
Question 2:
More general question about submodules - is it really needed to commit submodule changes into the main project? I know it is used to store the submodule's commit hash to the main project, because it is not stored in the .gitmodules file. But our submodules are tracked branches git submodule add -b BranchName ...
and developers always pull the latest submodule version using git submodule update --remote --merge
, is commiting it to the main project needed ? The main sense is that the submodules and main project are separated, so there seems to be no reason why the main project should know about submodule version/commit/history.