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 "Cannot find .gitmodules. The command must be run " >&2
12 echo "in the top-level directory of a repository with submodules" >&2
17 path="$(git config -f .gitmodules --get "submodule.$name.path")"
19 if [ -z "$path" ]; then
20 echo "Error: submodule $name does not exist" >&2
25 rm -rf "`git rev-parse --git-dir`"/modules/"$name" &&
26 exec git config --remove-section submodule."$name"