I’m noting these instructions on how to remove a git submodule for future reference:
- Delete the relevant line from the .gitmodules file.
- Delete the relevant section from .git/config.
- Run git rm –cached submodule_path.
- Commit and delete the now untracked submodule files.
- Run rm -rf submodule_path.
In general, I’m not very fond of git submodules. They are very clunky and can get messed up so easily. Compared to subversion externals, they are not very useful in my humble opinion.
Subversion externals acts just how I would expect - its a reference to another subversion repository within a subversion repository. Git submodules are pegged to a particulate commit of the other repository, and I’ve run into several problems with submodules becoming corrupt.