如何删除 GitLab 存储库中的标签

How do I remove Tag in GitLab repository

我正在使用 GitLab 7.7.2 并尝试删除 GitLab 存储库中的标签。 我可以删除本地存储库中的标签,但无法删除源中的标签。 如何删除 GitLab 存储库中的标签?

$ 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 git@git.aaa.bbb.ccc:root/Repository.git
 ! [remote rejected] Tag_AAA (pre-receive hook declined)
error: failed to push some refs to 'git@git.aaa.bbb.ccc:root/Repository.git'

显然您没有删除远程 GitLab 仓库中标签的权限。

要么请求repo的所有者授予你master的权限,要么让他帮你删除tag。

# delete locally:
git tag -d <tag>

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

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

您需要拥有维护者或所有者角色才能 rewrite/remove Git 标记。

查看 Git实验室权限:https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/user/permissions.md

现在(GitLab 12.1,2019 年 7 月),开发人员可以删除 (non-protected) 标签(不仅仅是维护者或所有者)

参见“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.

permission matrix已更新。
参见 issue 52954