i have a git repo with multiple submodules.
when checking out, i usually do as follows
git clone URL # without --recursive!
so i have a single main repository, checked out in master
git checkout mybranchname_main_repo
now i have a single main repository checked out in its branch
git submodule update --init # now i checkout submodules because now they point to their supposed branch hash and not the master
now have the main repository in its branch, with its submodules (repos) checkout out to the last commited hash which is typically also in a development branch and not master
the issue im having is that all submodules checkout the last commited hash value and not the branch/head.
is there a command that i can add an additional command making the submodules checkout the branch from their hash value in HEAD?
something like: (warning, this is pseudo code)
git submodule foreach checkout HEAD