How to search in commit messages using command line ?

How to search in commit messages using command line ?

Asked on January 10, 2019 in Git.
Add Comment


  • 3 Answer(s)

    Commit messages using command line;

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

    –git help log

     

    Answered on January 10, 2019.
    Add Comment

    Alternative below code for commit messages using command line;

    git log --oneline | grep PATTERN
    
    
    Answered on January 10, 2019.
    Add Comment
    git log --grep=<pattern>
        Limit the commits output to ones with log message that matches the 
        specified pattern (regular expression).
    Answered on February 20, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.