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 8352247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:54:39+00:00 2026-06-09T08:54:39+00:00

I want to use git log in a project to view only the commits

  • 0

I want to use git log in a project to view only the commits that have more than one line in their commit messages (i.e. they have a longer description). What is the best way to go about this?

I tried git log --grep='\n\n', and it came up with a list of commits with more than one line, but it was not a complete list. (I went back through some of the complete log manually and quickly found commits with multiline messages that were not output by my command.)

I then also tried git log --grep='\n\r\?\n', just in case there are Windows-style line endings in some of the commits (I’m using msysgit, so it might be possible?), but it came up with the same output as the above.

  • 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-09T08:54:40+00:00Added an answer on June 9, 2026 at 8:54 am

    This seems to work for me (on Linux):

    git log --pretty=format:'%H<msgst>%b<msge>' \
    | fgrep -v '<msgst><msge>' | fgrep '<msgst>' | cut -b1-40 \
    | git log --stdin --no-walk
    

    Basically: print commit hashes and commit message body (minus the subject line) wrapped in some uncommon strings, exclude lines where such body is empty (e.g. commits without newlines in the messages), then take just the first lines (those with commit hash at the beginning), and print only the hashes.

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

Sidebar

Related Questions

I want to use git log to show all commits that do not match
I don't want to submit projectname.project folder. Now, I use like that git add
we want to use git and one very important thing would be that if
I use git log, but I find it can only list logs under current
A noob here. I have a personal Macbook and I want to use Git
I want to use git log to get a list of changes starting with
I want a way to list all git authors that Is only since a
I want to use PHP writing git hooks but have some problem. I use
I like to use git on cygwin, but the only downside I have is
I have a variable full of text, its actually a git log. Each line

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.