Last Updated: February 25, 2016
·
1.44K
· ocubom

How to remove git submodules

Sometimes you want to remove an unused submodule. Git 1.8.3 eases the process with the new git submodule deinit but we can achieve the same effects in previous versions with this steps:

  1. Edit the file .gitmodules and .git/config and delete the submodule's section on both files.

  2. Delete the paths on your directory with git rm -r --cached path/to/MODULE.

  3. Commit the project.

Then you can remove the submodule's path contents (or add it as part of our repository).