- Delete the relevant line from the
.gitmodulesfile. - Delete the relevant section from
.git/config. - Run
git rm --cached path/to/submodule(no trailing slash). - Commit and delete the now untracked submodule files.
Source
- Chat conversation with JTJ.
.gitmodules file..git/config.git rm --cached path/to/submodule (no trailing slash).