Checkout a git tag with deeply nested 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
| # get a tag | |
| git checkout --force tags/mytag | |
| # from then on I am in a detached head state | |
| # then sync all submodule to point to the correct rev and force cleaning untracked dir and files | |
| git submodule foreach --recursive 'git submodule sync; git clean -ffd' | |
| # force update to get all submodule content | |
| git submodule update --init --recursive --force | |
| # clean again, forcing untracked file and dir deletion | |
| git clean -ffd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment