I did some svn to git migration. All my tags look 'strange' now:
7.18.2.0@3000
7.18.3.0@3000
7.18.4.0@3000
7.18.5.0@3000
But the tags are right. Only the name is wrong. Now I want to rename the tags.
So for every tag I want to do:
git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags
I want to script this. But I'm already stuck to find the right way how to iterate through all my tags.
How do I have to loop: for every tag do
...
what about a for
loop with git tag
output ?
for crt_tag in $(git tag)
do
# if you want to suppress @... part
git tag ${crt_tag%@*} $crt_tag
git tag -d $crt_tag
git push origin :refs/tags/$crt_tag
git push --tags
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With