且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取已检出修订的git标签?

更新时间:2023-01-17 18:36:48

我认为

git log -n 1 --pretty=format:'%d'

应该可以解决问题.

但是,它将为您显示当前修订版所具有的所有分支的名称和标签.我认为不可能仅获得用于签出修订版的单个标签.

However, it'll show you names of all branches and tags your current revision has. I don't think it's possible to get just the single tag that have been used to check out the revision.