Consider a git repository Foo/, which has submodules bar1/ and bar2/.
Each of these has the same branches: 1 & 2.
I enter the supermodule, and I want to
A submodule is always by default in detached HEAD mode.
You can make each submodule follow a branch.
See "How to make an existing submodule track a branch".
cd /path/to/your/parent/repo/Foo
git config -f .gitmodules submodule.bar1.branch branch1
git config -f .gitmodules submodule.bar2.branch branch2
Then all you need to do is:
git submodule update --remote
That will update each submodule to the latest of their respective upstream branch (fetch + checkout).