check if pushed tag is on the git remote
GitGit Problem Overview
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.
Git Solutions
Solution 1 - Git
Try
git ls-remote --tags origin
Solution 2 - Git
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>
Solution 3 - Git
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
Solution 4 - Git
Another way, (from "https://stackoverflow.com/questions/5549479/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