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 ran into this and didn't have a .git/modules directory in my main repository. I have one submodule 'build', so just removed any references and reinitialized it:
.git/modules
rm -rf .git/modules rm -rf build git submodule init git submodule update