How can I check if a tag exists in my GIT repo.
I get as input some tagname and I have to check if it's a valid tag with a if else statement.
TAG="tagname"
I tried:
if [ git rev-parse ${TAG} >/dev/null 2>&1 ]; then
echo "tag exists";
else
echo "tag does not exist";
But it didn't work