- Delete the relevant section from the .gitmodules file. The section would look similar to:
[submodule "vendor"]
path = vendor
url = git://github.com/some-user/some-repo.git
- Stage the .gitmodules changes via command line using:
git add .gitmodules
- Delete the relevant section from .git/config, which will look like:
[submodule "vendor"]
url = git://github.com/some-user/some-repo.git
- Run git rm --cached path/to/submodule . Don't include a trailing slash -- that will lead to an error.
- Run rm -rf .git/modules/submodule_name
- Delete the now untracked submodule files rm -rf path/to/submodule