check if pushed tag is on the git remote

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.


Solution 1:

Try

git ls-remote --tags origin

Solution 2:

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:

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