submodule_path=$1[-d"$submodule_path"]||(echo'Specify valid submodule path as first parameter'&&exit1)# Remove the submodule entry from .git/configecho"Deinitializing submodule $submodule_path"gitsubmoduledeinit-f$submodule_path# Remove the submodule directory from the superproject's .git/modules directoryecho"Removing .git/modules for $submodule_path"rm-rf.git/modules/$submodule_path# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submoduleecho"Removing files for $submodule_path"gitrm-rf$submodule_path