如何使用命令行搜索提交消息?

时间:2010-09-29 23:59:27

标签: git console

  

可能重复:
  How to search through all commits in the repository?

有没有办法使用命令行搜索提交标头?

2 个答案:

答案 0 :(得分:395)

git log --grep=<pattern>
    Limit the commits output to ones with log message that matches the 
    specified pattern (regular expression).

- git help log

答案 1 :(得分:180)

git log --oneline | grep PATTERN