If the purpose of the ls-remote is to match a tag with a hash, wouldn't it be easier to just: cat .git/refs/tags/<tagid> ? And if the purpose of knowing the tagid is to use that version of the code, wouldn't it be easier to just: git checkout <tagid> ?