Git 标签 - 结账问题
如果一个Git项目中有多个可用的标签,我们如何检查当前所有标签中哪个是签出的标签。
git tag
将列出所有标签,条目将出现在 .git/refs/tags 中
,例如: - 今天我们从主存储库进行了存储库同步,并获得了标签 1,并且我们签出了标签 1并开始研究它,几周后我们同步了内容并检查了新标签。
现在,如果我想检查最新状态,即当前签出的标签 - 我们该怎么做?
If there are multiple tags available in a Git project, how can we check, which is the checked out tag out of all the present ones.
git tag
will list all the tags, and entries will be present in .git/refs/tags
say for example: - today we did a repository sync from master repository and got tag 1 and we checkouted tag 1 and started working on it, few weeks later we synced the content and checked out new tag.
Now if I want to check the latest status, which is the current checked-out tag - how can we do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
git 描述
告诉您工作副本引用的最新标签。手册页摘录:
git describe
tells you the most recent tag that your working copy refers to.Excerpt from the man page:
这里有很好的答案,但另一种有时更友好的方式是使用 gitk:
对于任何给定的提交,它都会向您显示之前和之后最近的标签,更不用说带有代表的标签和分支的提交图的图形布局
Good answers here, but another, and sometimes friendlier way, is with gitk:
For any given commit, it will show you the nearest tags both before and after it, not to mention the graphical layout of the commit graph with tags and branches represented
这将为您提供提交祖先中最新标签的列表,我认为这就是您所要求的:
提交祖先中的最新标签将位于顶部。
您还可以使用:
它为您提供正常的 git 日志,并将标签添加到提交中。
This gives you a list of the most recent tags in your commit ancestry, which I think is what you are asking for:
The most recent tag in your commit ancestry will be at the top.
You can also use:
which gives you the normal git log with the tags added to the commits.