Rebasing a git branch with a submodule

Rebasing a branch with a submodule.

I ran into some difficulty; generally it should be simpler than this. The first difficulty was the submodule was staying

Before any of the below, make sure you have added, committed, and pushed the code in your submodule, from the submodule. Then and only then change into the directory with the main repository and do this:

git checkout master
git submodule update --recursive
git checkout --recurse-submodules more-updates
git rebase master
git push --force