Created
April 17, 2013 14:18
-
-
Save TheDeveloper/5404654 to your computer and use it in GitHub Desktop.
Usage: remove_submodule submodule_path Where submodule_path is the relative path to your submodule from the current directory. Must be run from the root of a git working copy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sweep a git submodule out of the working copy | |
remove_submodule() { | |
SMD_PATH=$1 | |
if [ ! -d $SMD_PATH ]; then | |
echo "$SMD_PATH does not exist" | |
return 1 | |
fi | |
git config -f .git/config --remove-section submodule.$SMD_PATH | |
git config -f .gitmodules --remove-section submodule.$SMD_PATH | |
git rm --cached $SMD_PATH | |
rm -rf $SMD_PATH | |
rm -rf .git/modules/$SMD_PATH | |
} | |
alias gsubrm='remove_submodule' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment