Shoji Urashita
Shoji Urashita

Reputation: 886

How do I remove Tag in GitLab repository

I am using GitLab 7.7.2 and tried to remove Tag in a repository in GitLab. I could remove tag in a local repository but cannot remove tag in origin. How do I remove tag in GitLab repository?

$ git tag -d Tag_AAA
Deleted tag 'Tag_AAA' (was d10bff2)

$ git push --delete origin Tag_AAA
remote: GitLab: You don't have permission
To [email protected]:root/Repository.git
 ! [remote rejected] Tag_AAA (pre-receive hook declined)
error: failed to push some refs to '[email protected]:root/Repository.git'

Upvotes: 53

Views: 75482

Answers (5)

DevThiman
DevThiman

Reputation: 1138

Incase someone use Gitlab UI (version 16.9.0, Jan 2024), you can manually delete protected tags easily. But you must have at least the Maintainer role in your project.

To get the tags, go to Project>>Code>>Tags as shows in below. You can delete tags using the delete button.

Setup git tags in Gitlab UI

Upvotes: 2

VonC
VonC

Reputation: 1327004

Now (GitLab 12.1, July 2019), a developer can remove a (non-protected) tag (not just a maintainer or owner)

See "Developer role can rewrite/remove Git tags"

Git tags are useful for referencing specific points and are typically used for tagging specific versioned releases.

To make git tags easier to use by development teams, we’re adding the ability to allow Developers to rewrite and remove non-protected tags.
Protected tags still require Maintainer or Owner permissions.

The permission matrix has been updated.
See issue 52954.

Upvotes: 11

Achraf JEDAY
Achraf JEDAY

Reputation: 2114

You need to have the maintainer or owner role to be able to rewrite/remove Git tags.

See GitLab permissions: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/user/permissions.md

Upvotes: 0

Yakir GIladi Edry
Yakir GIladi Edry

Reputation: 2851

# delete locally:
git tag -d <tag>

# delete remotely:
git push origin :refs/tags/<tag>

# another way to delete remotely:
git push --delete origin <tag>

Upvotes: 36

liushuaikobe
liushuaikobe

Reputation: 2190

Obviously you don't have the permission of deleting tags in remote GitLab repo.

Either ask for the owner of the repo to grant you the permission of master or let him help you to delete the tag would help.

Upvotes: 28

Related Questions