Delete submodule Git

Posted by Carles Loriente on December 29, 2019 · 1 min read

How to delete a Git submodule.


git submodule deinit -f -- a/submodule
rm -rf .git/modules/a/submodule
git rm -f a/submodule

Download the GitHub Gist delete-git-submodule.sh

Remember to commit and push your changes to the repo.

Found a snippet that saved your day? Consider dropping a tip!