top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

searching commit msg in git log

+1 vote
721 views

I am trying to grep for git commit msg in git log...once I do git log..the log is really huge? Is there a way to get only the last 100 commits or is there an efficient way to search commit msg in git log?

posted Jul 17, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

To limit the number of logs shown use git log -n where n is the number og logs you want, ex. to show only last 5 commit logs, you can do git log -5
To search for commit message in git logs, use git log --grep "message you want to search"

answer Jul 17, 2013 by anonymous
0 votes

If your goal is to find a single commit with a particular phrase in the commit message, my approach would be put redirect the output of "git log" into a file, read the file into an editor, and search for the desired phrase. Hmmm...

Perhaps this option to "git log" helps:

--grep=

Limit the commits output to ones with log message that matches the specified pattern (regular expression). I found that by searching the "git-log" manual page for "message".

answer Jul 17, 2013 by anonymous
Similar Questions
+1 vote

When run that command immediate after "git bisect start" somebody sees the full commit range as defined in "git bisect start".

However running that command later after few git bisect steps" somebody is just presented with the remaining commit interval. Is this intended ?

+1 vote

Is there any explanation available of the different merits and drawbacks of the diff algorithms that Git supports?

I'm not satisfied with the default diff but have enough processing power for a slower algorithm that might produce diffs that better show the intention of the edit.

+2 votes

Could somebody tell me how to make git rebase -i show diff of squashed commits (for example), like git commit -v does it?

...