Last active
May 10, 2019 05:03
-
-
Save gotev/e7e5711458cee374315a5d3f67c4bbfc to your computer and use it in GitHub Desktop.
Remove git submodule
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
#!/bin/bash | |
NAME="$1" | |
if [ "x$NAME" == "x" ]; then | |
echo "please tell me the submodule name to remove" | |
exit -1 | |
fi | |
TMP_NAME="${NAME}_tmp" | |
mv "$NAME" "$TMP_NAME" | |
git submodule deinit -f -- "$NAME" | |
rm -rf ".git/modules/$NAME" | |
git rm -f "$NAME" | |
git rm --cached "$NAME" | |
rm -rf "$TMP_NAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment