#!/bin/bash # Git repository REPO="git://git.netsurf-browser.org/libnsgif.git" # Get tag name using 'git ls-remote' TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | tail -1 | cut -d'/' -f4) echo "$TAG_NAME"