-
-
Save chp-io/517f9c93d1fca0b869d1b82e9ab80052 to your computer and use it in GitHub Desktop.
Cleans and resets a git repo and its submodules
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/sh | |
git reset --hard | |
git submodule foreach --recursive 'git reset HEAD . || :' | |
git submodule foreach --recursive 'git checkout -- . || :' | |
git submodule update --init --recursive | |
git clean -d -f -f -x | |
git submodule foreach --recursive git clean -d -f -f -x | |
#TODO add submodule filtering argument | |
# git -c submodule."third-party/repo-name".update=none submodule update --init --recursive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment