Remove (deinit) a Git submodule

A quick reminder of how to remove a Git submodule, because I always forget

Every once in a while, I need to deinit a Git submodule, but I just cannot get my brain to remember how, so here's my reminder:

git submodule deinit -f path/to/submodule
rm -rf .git/modules/path/to/submodule
git rm -f path/to/submodule

After those three commands, you're free to commit the deinit. Note that this will not actually remove the submodule locally, you'll need to rm -r to take care of that.

To make things just a bit easier, we can stick those three lines into a script and call it with a Git alias.