I'd like to promote the idea of monorepo within my company.
I'd plan to use them this way:
I have one 'parent' repo holding one submodule for each components of our stack, thus maintaining a global versioning for the whole stack (we can simply checkout every components on a given branch)
This sounds perfect because we can still benefit of any CI services out of the box (has we still push on independent git repo, the submodules).
The only (terrible) weakness with this approach, is that if a do a
git submodule update --remote
Using the following config:
[submodule "commonLib"]
path = commonLib
url = git@github.com:org/commonLib.git
branch = MY_BRANCH
Each submodule is effectively check-outed at the right commit.
But: They are all in detached Head
Why there no way to effectively use gitsumodule with branch. i.e: when updating, effectivly check-out the branch and not the commit pointed by this branch ? Is there for a technical reason or simply not yet implemented in git ?
Thanks