Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:35:30+00:00 2026-06-03T10:35:30+00:00

git log –grep=searchstring appears to only search the first line of every commit message.

  • 0

git log --grep=searchstring appears to only search the first line of every commit message. How do I search the entire commit message?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:35:31+00:00Added an answer on June 3, 2026 at 10:35 am

    What version of git are you using? With version 1.7.7.6, the --grep option appears to search through the entire content of commit messages. Take for example this log:

    $ git log
    commit 7d3f6ed90467f40de32ea4e59f8fa4172735d577
    Author: Lars Kellogg-Stedman <lars@seas.harvard.edu>
    Date:   Wed May 9 14:10:12 2012 -0400
    
        i added a file
    
        this is the second line.
    
    commit 3aaf84486d0f1eb41fb5406254f795a581ef0ce2
    Author: Lars Kellogg-Stedman <lars@seas.harvard.edu>
    Date:   Wed May 9 14:10:01 2012 -0400
    
        i made a change
    
    commit eb6cd7773ff68808a9eda2e7edb8fbffcc1f6759
    Author: Lars Kellogg-Stedman <lars@seas.harvard.edu>
    Date:   Wed May 9 14:09:45 2012 -0400
    
        this is the first line
    
        this is the second line
    

    If I grep for the word second, I get:

    $ git log --grep=second
    commit 7d3f6ed90467f40de32ea4e59f8fa4172735d577
    Author: Lars Kellogg-Stedman <lars@seas.harvard.edu>
    Date:   Wed May 9 14:10:12 2012 -0400
    
        i added a file
    
        this is the second line.
    
    commit eb6cd7773ff68808a9eda2e7edb8fbffcc1f6759
    Author: Lars Kellogg-Stedman <lars@seas.harvard.edu>
    Date:   Wed May 9 14:09:45 2012 -0400
    
        this is the first line
    
        this is the second line
    

    This is clearly matching something other than the first line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[root@234571-app2 git]# ./test.py File ./test.py, line 4 with open(/home/git/post-receive-email.log,'a') as log_file: ^ SyntaxError: invalid
I ran: git log --diff-filter=D --summary and I see the deleted file: commit abc123abc123
I use git log, but I find it can only list logs under current
I'm customizing my git log to be all in 1 line. Specifically, I added
When I run git commands like git commit or git log --shortstat part of
I did a commit and reverted with git revert HEAD^ just git log ➜
When I check out a previous commit of a git repository, 'git log' no
On a test Git repository, git log yields: commit e1f972f22f9906ad62007b4e372d8dc06bc47656 Author: davidandreoletti Date: Sun
I have a git commit template as below: [overtype with subject line up to
Why does git log --decorate not display more than one tag per commit? EDIT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.