Skip to content

Instantly share code, notes, and snippets.

@jon
Created May 21, 2010 08:43
Show Gist options
  • Save jon/408631 to your computer and use it in GitHub Desktop.
Save jon/408631 to your computer and use it in GitHub Desktop.
#!/bin/sh
if ! [ "$#" = "1" ]; then
echo "Usage: $0 <submodule name>"
exit 1
fi
name="$1"
path=$(git config -f .gitmodules submodule."$name".path)
git config --remove-section submodule."$name"
git config -f .gitmodules --remove-section submodule."$name"
git rm --cached "$path"
rm -rf "$path"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment