I can't get submodules to checkout the correct branch, they always end up in a specific, old commit.
Example: I have a repo which has 3 submodules, linked in the .gitmodules:
[submodule "repo-web"]
path = repo-web
url = git@github.com:Project/repo-web.git
branch = task/test_install
[submodule "report-templates"]
path = report-templates
url = git@github.com:Project/report-templates.git
branch = master
[submodule "Project-python"]
path = Project-python
url = git@github.com:Project/Project-python.git
branch = dev
When I do a fresh install of the repo and download the submodules by either
git submodule update --init --recursive --remote
or
git clone --recursive https://github.com/Project/repo.git
the submodules seem to be linked to specific commit, all 3 of them alway end up with a detached head. Also, when I look at them at Github, they all have the format
repo-web @ ce80174
which is the commit that they are linked to.
.git.config:
[submodule "repo-web"]
url = git@github.com:Project/repo-web.git
How to get the correct branch?