Git:git logコマンドでコミットメッセージを検索(grep)する方法


git logコマンドでコミットメッセージを検索(grep)する方法

git logコマンドでコミットメッセージを検索(grep)するには--grepオプションを指定します。



     Limit the commits output to ones with log message that matches the specified pattern (regular expression). With more than one --grep=, commits
     whose message matches any of the given patterns are chosen (but see --all-match).

     When --notes is in effect, the message from the notes is matched as if it were part of the log message.



$ git log --grep='from hell' | head
commit 57d84f8d93a0e0818fc403c5b1a2ba73ce0eca5a
Author: Nguyễn Thái Ngọc Duy <>
Date:   Mon Aug 6 18:27:09 2012 +0700

    read_index_from: remove bogus errno assignments

    These assignments comes from the very first commit e83c516 (Initial
    revision of "git", the information manager from hell - 2005-04-07).
    Back then we did not die() when errors happened so correct errno was