Skip to content

Instantly share code, notes, and snippets.

@jonathanstowe
Created February 4, 2017 12:30
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 jonathanstowe/c0b5be2abb2f45d5b1018984f7dcf6ae to your computer and use it in GitHub Desktop.
Save jonathanstowe/c0b5be2abb2f45d5b1018984f7dcf6ae to your computer and use it in GitHub Desktop.
Remove unwanted submodules
for DIR in *
do
if [ -d $DIR ]
then
if [ -f $DIR/.gitmodules ]
then
pushd $DIR
git status
MOD=`cat .gitmodules | awk '/path = / { print $3 }'`
git reset HEAD
rm -rf $MOD
rm .gitmodules
popd
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment