Git Tag list, display commit sha1 hashes

后端 未结 8 1103
无人共我
无人共我 2020-12-12 17:56

so the git tag command lists the current git tags

tag1
tag2

git tag -n prints tag\'s message

tag1         


        
8条回答
  •  囚心锁ツ
    2020-12-12 18:26

    I took the command from anatoly techtonik post added the headline message of the tags/commits and formated it as nice cols.

    The result is a output identical to git tag -n but with commit-hash as prefix.

    git for-each-ref --format='%(if)%(*objectname)%(then)%(*objectname:short)%(else)%(objectname:short)%(end)|%(refname:short)|%(contents:subject)' refs/tags | column -t -s '|'
    

    If you like to have the long-hash instead of the short, yust replace objectname:short by objectname.

提交回复
热议问题