Skip to content

Instantly share code, notes, and snippets.

@MasWag
Created December 11, 2012 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasWag/4255594 to your computer and use it in GitHub Desktop.
Save MasWag/4255594 to your computer and use it in GitHub Desktop.
removing git submodule
#!/bin/sh
#This script removes a submodule of git.
#All you have to do is to put this script to a pathed directiry, and type `git submodule-rm <submodule>`
#(You may have to type `chmod +x git-submodule-rm`) :P
if [ $# -ne 1 ] ; then
echo "usage: git submodule-rm <submodule>";
echo "No submodule specified, no submodule removed." 1>&2;
exit 1;
fi
git config --remove-section submodule.$1
git config --file .gitmodule --remove-section submodule.$1
git rm --cached $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment