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?
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.
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.
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.
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 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?
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 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.
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With