I have parent project A,
git branch -a:
* develop
master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/master
A's develop branch depends on a submodule subA, but master branch doesn't.
and subA have these branches:
git branch -a:
* develop
master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/master
the .gitmodules file :
[submodule "subA"]
path = subA
url = https://someDomain/suA.git
branch = develop
here's the problem,
I get into the parent project's directory, switch from branch develop to master, everything goes well cause master branch doesn't depend on subA, but when I use git checkout develop --recurse-submodules to switch back to the develop branch, the suA's branch status is always like this,
* (HEAD detached at refs/heads/develop)
develop
master
I know I can fix it by git checkout develop, but I want to figure it out why --recurse-submodules doesn't work, and whether is there a solution to let submodules switch branches from the parent projects correctly.
git version 2.30.1 (Apple Git-130)