So I can clone a branch and get all the submodules with:
git clone <url> -b myBranch --recursive
This is great :) But then I want to switch to a different branch, so I do:
git checkout myBranch2
This updated the top-level of my project, but not the submodules (I did not see a recursive option here). Infact I got an output that suggests it knows that the submodules need updating, but I just don't know how to do that part:
c:\dev> git checkout myBranch2
M SubModule1
M SubModule2
Branch myBranch2 set up to track remote branch myBranch2 from origin.
Switched to a new branch 'myBranch2'
So then I checked the version of the SubModule1 and it is still pointing to the version that was originaly checked out (the latest) and not the version it should be pointing to (about 3 checkins older) that was associated with the branch myBranch2.
Of course I could just clone a new one and have both - this is what I would normally do, but it bugs me that I don't know how to do this... and it might be useful.