My usual git workflow is
git checkout -b branch_name
.... <do my thing>
git commit -am 'some comment'
git fetch
git merge origin/develop
.... <do some more things>
git commit -am 'more things'
git push
Unfortunately the repo I'm working on has submodules (which I never modify, but others do). If I do the above and if the merge updated submodules, the second commit pulls in the old version of the submodules and I end up with unintended submodule changes in my pull request.
I know I can just do git submodule update --init --recursive
after the merge. But it's fairly easy to forget, and I don't always want to do this (e.g. when just jumping to another branch to change something and jumping back)
My Question
Is there some alternative to git commit -am 'blahblah'
which commits everything OUTSIDE of submodules?
I realize I'll have to update them for my code to work properly. But I just don't want to have the problem of accidentally committing them.
I'd also like to avoid automatically update them when merging/switching branches - as this makes it slower and more cumbersome to jump around.