Based on http://stackoverflow.com/questions/1260748/how-do-i-remove-a-git-submodule/16162000#16162000
git submodule deinit path/to/submodule
git rm path/to/submodule
Based on http://stackoverflow.com/questions/1260748/how-do-i-remove-a-git-submodule/16162000#16162000
git submodule deinit path/to/submodule
git rm path/to/submodule
Based on
Delete the relevant section from .git/config:
git config -f .git/config --remove-section submodule.SUBMODULE_NAME
Delete the relevant section from the .gitmodules file:
git config -f .gitmodules --remove-section submodule.SUBMODULE_NAME
Stage the .gitmodules changes:
git add .gitmodules
Stage removal of the submodule:
git rm --cached path/to/submodule # N.B. no trailing slash
Remove files from the file system:
rm -rf .git/modules/path/to/submodule
Commit changes:
git commit -m 'Removed submodule SUBMODULE_NAME'
Delete the now untracked submodule files:
rm -rf path/to/submodule