Created
July 27, 2010 03:10
-
-
Save birkirb/491663 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# = USAGE | |
# git submodule reset | |
function submodule_paths { | |
ref=$(git ls-files --error-unmatch --stage -- . | grep "^160000" | awk '{print $4}' | uniq) | |
echo "${ref}" | |
} | |
function reset_submodule { | |
git add $1 | |
git reset HEAD $1 | |
} | |
for path in $(submodule_paths) | |
do | |
reset_submodule $path | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment