Removing Submodule

  1. Remove the submodule entry from .git/config1

    git submodule deinit -f path/to/submodule
    
  2. Remove the submodule directory from the superproject’s .git/modules directory1

    rm -rf .git/modules/path/to/submodule
    
  3. Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule1

    git rm -f path/to/submodule
    
  4. Remove cached entries; Delete .gitmodules before doing this, if it hasn’t deleted already2

    rm -rf path/to/submodule
    
comments powered by Disqus