2 # See https://stackoverflow.com/q/1260748/7976758
5 echo "Usage: $0 submodule_name" >&2
9 cd `git rev-parse --show-toplevel` || exit 1
10 if [ \! -f .gitmodules ]; then
11 echo "The command must be run in the top-level directory" >&2
16 path="$(git config -f .gitmodules --get "submodule.$name.path")"
18 if [ -z "$path" ]; then
19 echo "Error: submodule $name does not exist" >&2
24 rm -rf .git/modules/"$name"
25 exec git config --remove-section submodule."$name"