2025-11-30
2025-11-29
获取当前分支的最近 tag 是用这条命令还是这条,就不能搞一条简单的指令么
You’d think there’d be a dead-simple Git command to return the latest tag pointing to the current branch. But the answer, as with many things in Git, is a bit more nuanced. If you’re here for a quick fix, here’s the magic one-liner:
git describe –tags $(git rev-list –tags –max-count=1)
git describe –abbrev=0
https://medium.com/code-kings/git-how-to-get-the-latest-git-tag-from-your-current-branch-without-the-guesswork-31a4fd57a029
