git checkout branch and update submodules

C++
git submodule update --recursive --remote
git checkout --recurse-submodule
Source

Also in C++: