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
### 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 |
Resources
- http://nathanhoad.net/how-to-delete-a-remote-git-tag
- http://www.linuxquestions.org/questions/programming-9/bash-read-every-line-in-the-files-and-use-the-line-as-parameters-as-another-program-246291/
- http://stackoverflow.com/questions/1605232/use-bash-to-read-a-file-and-then-execute-a-command-from-the-words-extracted