Here is my scenario:
Master-branch:
git main repo [branch:master]
-> submodule
---> subMod_A [branch:alfa tracking origin/alfa]
Hotel-branch
git main repo [branch:hotel]
-> submodule
---> subMod_A [branch:beta trakcking origin/beta]
Edit 1 [clarification]:
Changing from Master to Hotel branch, also changes the submodule branch from alfa to beta branch. This is intended.
We do this because we have electronics with minor variations in implementation.
When I switch between Master and Hotel, the submodule HEAD is always detached. I've already tried with submodule.subMod_A.update=rebase/merge with the same result.
Edit 2:
git submodule status
The output confirms that it is on the new branch with the correct commit id. But I still have to "reattach" it by hand with checking out the branch again
What would be the best/standard way of achieving this?
Best regards framet