MeloS
MeloS

Reputation: 7938

Git: how do you know who pushed a tag?

Some one in my team pushed a useless tag to remote, and I deleted it in my local working copy then pushed it to remote, the tag disappeared.

But before I deleted this tag, many people had already pulled this tag to their local working copy, anyone who pushes again(by selecting the "push all tags" in SourceTree) will recreate these tags.

By using git show <tagname>, I can only see who create the tag the first time, but how can I find who pushed the tag again?

Upvotes: 20

Views: 6139

Answers (1)

Harry Dobrev
Harry Dobrev

Reputation: 7706

Even if you have annotated tags where the tagger is saved in the tag object, you still can't see who has pushed it unless you save it on the server at the time of pushing it. GitHub/GitLab Enterprise editions may provide this for you.

However, your root problem is that everyone need to delete that tag on their local machines so it's not pushed back up.

If people don't have local-only tags they can run the following to delete all local tags which are not found in the remote repository:

# Delete all local tags
git tag -l | xargs git tag -d
# Fetch remote tags
git fetch -t

I hope that helps!

Upvotes: 10

Related Questions