I'm trying to use git submodules for aggregating 10+ repositories into one structure for easy development.
It is supposed to clone the module and checkout a branch. Instead, the module is checked out in detached head mode.
git clone [email protected]:org/global-repository.git
git submodule update —init
cd config-framework
git status
$git status
#HEAD detached at b932ab5
nothing to commit, working directory clean
gitmodules files seems to be okay
$cat .gitmodules
[submodule "config-framework"]
path = config-framework
url = [email protected]:org/config-framework.git
branch = MY_BRANCH
We want the MY_BRANCH branch to be checked out by default, rather than detached head. How do we achieve that?