How to un-submodule a git submodule?
Assuming you have the following repository structure, and you are under
project ├── .git ├── some_dir ├── some_file └── sub_module_dir ├── .git └── more_files
I could un-submodule my
sub_module_dir (e.i: remove git submodule without deleting the directory) with:
git rm --cached ./sub_module_dir
After this, the files inside directory were available to parent git repository for tracking, and
sub_module_dir was visible as deleted in git status (as it has been removed as a submodule). But don’t worry, this command doesn’t delete the directory.