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.
In order to list remote Git tags, you have to use the “git ls-remote” command with the “–tags” option and the name of your remote repository.
Sharing TagsBy default, the git push command doesn't transfer tags to remote servers. You will have to explicitly push tags to a shared server after you have created them. This process is just like sharing remote branches — you can run git push origin <tagname> .
Sharing tags is similar to pushing branches. By default, git push will not push tags. Tags have to be explicitly passed to git push .
Push all git tags to remote And if you want to push all tags from your local to the remote then add "--tags" to the git command and it will push all tags to the remote.
Try
git ls-remote --tags origin
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>
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
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