Skip to content

Instantly share code, notes, and snippets.

@json2d
Last active September 13, 2018 06:27
Show Gist options
  • Save json2d/192be45b3451c22300225881ca835489 to your computer and use it in GitHub Desktop.
Save json2d/192be45b3451c22300225881ca835489 to your computer and use it in GitHub Desktop.
removing a git submodule binding properly w/o deleting files https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule
#!/bin/bash
mv $1 $1_tmp
git submodule deinit -f -- $1
rm -rf .git/modules/$1
git rm -f $1
# Note: a/submodule (no trailing slash)
# or, if you want to leave it in your working tree and have done step 0
git rm --cached $1
mv $1_tmp $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment