There are two ways for searching the commit messages in the command line;
You could use:
git log --grep=<pattern>
Which limits the commit output to one with a log message that matches the specified pattern.
Or else you could use:
git log --oneline | grep PATTERN
Both these ways are helpful in search of commit messages using the command line.