Log search

Finding a log with a certain string in the commit message:

git log --grep=query

Content search

Finding a commit where a given string was introduced in the code:

git log -Squery

Same as the previous, but using a regex instead of string matching:

git log -Gquery

Word difference comparison

Running a diff based on words rather than lines (useful when managing a blog, documentation, or scientific writing in LaTeX):

git diff --word-diff HEAD~1