Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: how do you know who pushed a tag?

Tags:

git

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?

like image 647
CarmeloS Avatar asked Aug 20 '15 13:08

CarmeloS


People also ask

Can you see who created a tag in git?

They're just refs in the refs/tags namespace, but they point to commits instead of tag objects. This means there are no details to show.

Which tags are pushed with git push?

Sharing Tags git push <remote> --tags will push both lightweight and annotated tags. There is currently no option to push only lightweight tags, but if you use git push <remote> --follow-tags only annotated tags will be pushed to the remote.

Are tags pushed git?

Sharing tags is similar to pushing branches. By default, git push will not push tags. Tags have to be explicitly passed to git push . To push multiple tags simultaneously pass the --tags option to git push command.

How do I see git tags?

Listing the available tags in Git is straightforward. Just type git tag (with optional -l or --list ). You can also search for tags that match a particular pattern. The command finds the most recent tag that is reachable from a commit.

How do I push a tag in Git?

How do you Git push a tag? After you have created your Git tag, you will have the ability to Git push the tag to your remote. By default, Git tags are stored locally on your machine and are not pushed when the Git push command is run. How do you Git push a tag in GitKraken?

How to check if a commit has been tagged in Git?

At any time you can check if the current commit is tagged or what is the most recent tag name and how many commits ago it has been created: By default, the git describe command ignores “lightweight” tags. Push Tag to Remote: The git tag command creates a local tag with the current state of the branch.

How do I push a tag to another repository in GitKraken?

How do you Git push a tag in GitKraken? To Git push a tag in GitKraken, simply right-click on the Git tag and select Push <tag-name> to origin . Now, because you have Git pushed your tag, it will be pulled down whenever someone performs a Git pull on your remote repository.

What is a Git tag?

Tags in Git are used to label specific commits (to mark releases, for example). In this note i will show how to create a Git tag and push it remote repository using the git tag and git push commands.


1 Answers

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!

like image 119
Haralan Dobrev Avatar answered Oct 06 '22 14:10

Haralan Dobrev