Change the tag of a release in Gitlab

Viewed 252

I needed to rename tags in a gitlab repo by

git tag new old
git tag -d old
git push origin new :old

but now I stuck with releases, which are linked to the old tags. Is the only solution to create new Releases and delete the old one like this?

1 Answers

Is the only solution to create new Releases and delete the old one

Possibly, because the idea of a release is to be reproductible from an immutable tag.

If a tag is mutated (here, renamed), a new release should be done (even though the tag references the same code).

GitLab 15.4 (September 2022) illustrates that relation with:

Add associated release link to single tag page

In this update, you can now see the associated release when viewing a specific tag’s information page. This allows you to easily know if a release has been created based on that specific tag and to navigate to the release.

https://about.gitlab.com/images/15_4/release-show-release-in-tag-page.png -- Add associated release link to single tag page

See Documentation and Issue.

Related