If you have:
rm
instead of git rm
;.gitmodules
;.git/config
;And you're still getting the error, what solved it for me was readding back an empty folder, where the submodule used to be. You can do this with:
mkdir -p path/to/your/submodule
touch path/to/your/submodule/.keep
.keep
is just an empty file. git commit
it and the error should disappear.