So I\'ve done some work in the repository and when I\'m about to commit I realize that I\'m not currently on any branch.
This happens a lot when working with submodu
Alternatively, you could setup your submodules so that rather than being in their default detached head state you check out a branch.
Edited to add:
One way is to checkout a particular branch of the submodule when you add it with the -b flag:
git submodule add -b master
Another way is to just go into the submodule directory and just check it out
git checkout master