Created
May 13, 2009 14:38
-
-
Save knu/111055 to your computer and use it in GitHub Desktop.
How to mass-rename tags and push them with Git
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
# Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes | |
git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have a mixture of vx.y.z and x.y.z tags, the first command will add a v to your existing 'v' tags, creating vvx.y.z tags...
This shell script solves that issue: