To remove a submodule you need to:
git submodule deinit <path_to_submodule>
git rm -f <path_to_submodule>
git commit-m "Removed submodule "
rm -rf .git/modules/<path_to_submodule>
- Delete the relevant section from .git/config.
- Stage the .gitmodules changes git add .gitmodules
- Run git rm –cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m “Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
(source)