Reputation: 989
Anyone know how to check if a tag is on the git remote after the tag is pushed from the local?
It seems that the only way to do it is to fetch the remote.
Upvotes: 83
Views: 34573
Reputation: 3295
For lazy people like me, I used to search for it like this:
On remote tags:
git ls-remote --tags origin | grep TAG_NAME
On local tags.
git tag -l | grep TAG_NAME
Upvotes: 8
Reputation: 5546
To more precisely answer this question, to check if a specific tag is in a given remote use:
git ls-remote <remote-name> refs/tags/<tag-name>
Upvotes: 48
Reputation: 2764
Another way, (from "git: check if commit xyz in remote repo?")
git branch -r --contains my_tag
# ==== or with a sha1: =====
git branch -r --contains 2e29022d
This will list the remote branches that contain the tag or commit.
The output will look like:
origin/my_branch_1
origin/my_other_branch
origin/master
Upvotes: -3