Determine latest received git tag

你说的曾经没有我的故事 提交于 2019-12-04 13:18:32

Try this:

git describe --tags --abbrev=0 branch_name

to retrieve the name of the latest tag searching back from the tip of the desired branch, rather than HEAD (the current checkout).

That is, if your auto-update script has fetched origin master, you can do

git describe --tags --abbrev=0 origin/master

Note: --abbrev=0 makes describe return only the tag name, without a sha1 at the end. --tags makes describe return the latest annotated or unannotated tag. See git-describe(1) for a full discussion of the possible options.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!