【问题标题】:Skip git commits with a specific string using git log [duplicate]使用 git log 跳过带有特定字符串的 git 提交 [重复]
【发布时间】:2015-06-25 12:45:50
【问题描述】:

我想使用不包含特定字符串的 git log 获取最新的 5 次提交,例如“Merge branch”。

我尝试了几个选项,但都没有奏效。例如:

 git log -n 5 --grep="Merge branch" --invert-grep
 git log -n 5 -v --grep="Merge branch"
 git log -n 5 --not --grep="Merge branch"

似乎 --invert-grep 完成了这项工作,但它不起作用 (http://git-scm.com/docs/git-log)

【问题讨论】:

    标签: git grep commit git-log


    【解决方案1】:

    如果您特别想寻找非合并提交,您可以使用:

    git log -n 5 --no-merges
    

    当然,这也会跳过日志消息中不包含“合并分支”的合并提交。

    【讨论】:

      猜你喜欢
      • 2018-03-11
      • 2010-10-18
      • 2015-09-19
      • 2015-05-08
      • 2018-04-05
      • 2014-06-30
      • 2019-03-09
      • 2011-11-06
      相关资源
      最近更新 更多