I was trying to remove one sub-module from the project
Tried rm -rf .git/modules/submodulePath
After that I am having the issue
I've just hit this problem.
In my case, this was due to checkout branches with different submodules.
For some reason, they were impossible to initialize with:
git submodule update --recursive --init
I've needed to manually delete this files/diretories before update worked properly.
{submodule-path}/.git
.git/modules/{submodule}/config