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
23 git submodule deinit -f -- "$path"
24 rm -rf .git/modules/"$name"
25 exec git rm -rf "$path"