If you haven’t already run git rm --cached
path_to_submodule (no trailing slash) as well as rm -rf path_to_submodule
, do that!
Then:
- Delete the relevant lines from the
.gitmodules
file. e.g. delete these:
1 | [submodule "path_to_submodule"] |
- Delete the relevant section from .git/config. e.g. delete these:
1 | [submodule "path_to_submodule"] |
rm -rf .git/modules/path_to_submodule
Then, you can finally:
1 | git submodule add https://github.com/path_to_submodule |