【问题标题】:Which tag happened after a commit in git?在 git 中提交后发生了哪个标签?
【发布时间】:2016-10-05 00:41:23
【问题描述】:

对于给定的提交,是否可以确定提交后最近的标签?我不知道如何使用 git describe 或 git log 做到这一点?

示例: 我们标记所有版本。我想生成描述提交进入哪个版本的发行说明。我可以获得最新的标签,但这仅显示它之前的版本。我想知道它之后是哪个版本

【问题讨论】:

  • git-describe 手册页字面意思是 --contains: Instead of finding the tag that predates the commit, find the tag that comes after the commit, and thus contains it....

标签: git


【解决方案1】:

git describe --contains 怎么样

来自git documentation

--包含 不要找到提交之前的标签,而是找到提交之后的标签,从而包含它。自动暗示 --tags。

【讨论】:

    【解决方案2】:

    听起来像你想要的git describe --contains <commit>

    --包含

    不要找到提交之前的标签,而是找到提交之后的标签,从而包含它。自动暗示 --tags。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-03
      • 2010-12-24
      • 2017-12-19
      • 2015-12-06
      • 1970-01-01
      • 2013-05-01
      • 2021-06-15
      • 2011-08-22
      相关资源
      最近更新 更多