查看谁删除了git标签 [英] See who deleted git tag
问题描述
是否有可能找到谁从存储库中删除了git标签?
Is it possible to find who deleted a git tag from a repository?
假设您有一个包含贡献者的存储库.该存储库具有 dev
标记和版本: v0.1.0
, v0.1.1
等.
Suppose you have a repository with contributors. The repository has the dev
tag and versions: v0.1.0
, v0.1.1
etc.
有人删除标签.您如何找到谁删除了git标签?
Someone deletes a tag. How would you find who deleted the git tag?
推荐答案
您有两种类型的标签:
- 轻巧
- 带注释的
轻量级标签仅是提交的元数据.他们自己没有作者.说标签的作者是提交的作者是错误的,因为其他任何人都可以使用轻量级标签来标记该提交.
The lightweight tags are only metadata for a commit. They have no author by themselves. Saying that the author of a tag is the author of the commit is wrong, since anyone else could have tagged that commit with a lightweight tag.
带注释的标签与提交类似.这就是为什么在创建带注释的标签时也需要消息的原因.他们有作者,描述等.
The annotated tags are on the other hand like commits. That is why the annotated tags also need a message when you create them. They have an author, description, etc.
因此,要了解标签的作者,您必须具有带注释的标签策略.但是,据我所知,没有git repo元数据( .git
目录)的历史记录.这意味着您不知道谁删除了标签/分支/等,除非您的git提供者具有一种审核/记录/此的机制.
So, to know the authors of your tags, you must have an annotated tag policy. But, from what I know there is no history of a git repo metadata (.git
directory). This means you cannot know who deleted a tag/branch/etc, unless your git provider has a mechanism to audit/log/this.
这篇关于查看谁删除了git标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!