Problem
In VSCode, when trying to commit changes, there is a file that won’t be staged, and that is actually a directory. When we click that file in the git panel, we get the error message in the title.
Solution
Delete the .git
directory in that directory.
rm -rf name_of_the_directory
Then remove the submodule from your main repository.
git rm --cached name_of_the_directory