- Remove sub module section from the
.gitmodulesfile.
nano .gitmodules- Stage the change
git add .gitmodules- Remove sub module section from the
.git/configfile.
nano .git/config- Remove git cache
git rm --cached submodule-path`- Remove git module files:
rm -rf .git/modules/submodule-path- Commit changes
git commit -m "Removed submodule"- Delete untracked submodule files:
rm -rf submodule-path