How To Delete a Git Submodule
To delete a submodule from git, do the following:
- Delete the relevant section from the
.gitmodules
file. - Delete the relevant section from the
.git/config
file. - Run
git rm --cached <path_to_submodule>
. - Run
git rm --cached <path_to_submodule>
. - Run
rm -rf .git/modules/<path_to_submodule>
. - Commit the changes.