Created
October 31, 2012 20:23
-
-
Save house9/3989586 to your computer and use it in GitHub Desktop.
build and execute multiple git commands
This file contains hidden or 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
### matches all git tags that start with numeric value, update regex as needed | |
# commands to remove local tags | |
git tag -l | grep "^\d" | sed 's/^/tag -d /' > _remove_tags | |
# commands to remove remote tags | |
git tag -l | grep "^\d" | sed 's/^/push origin :refs\/tags\//' > _remove_tags_remote | |
# review contents of file | |
cat _remove_tags | while read line; do echo $line; done | |
# execute each line in file | |
cat _remove_tags | while read line; do git $line; done | |
# review contents of file | |
cat _remove_tags_remote | while read line; do echo $line; done | |
# execute each line in file | |
cat _remove_tags_remote | while read line; do git $line; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git tag -l | grep "^\d" | sed 's/^/git push origin :/' | sh
git tag -l | grep "^\d" | sed 's/^/git tag -d /' | sh