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 error after I moved a git repository to a different folder. When I looked in:
{submodule}/.git
I saw a single line with an absolute path, e.g.:
gitdir: /Users/ajx/Documents/repo/.git/modules/{submodule}
I changed this to a relative path, e.g.:
gitdir: ../../.git/modules/{submodule}
I'm not sure why git would hardcode absolute paths...