FahamLah

Commands

git log (-S

git log (-S <text> | -G <regex> | --author=<name> | --grep=<text>)

Risk: Safe

What it does

Finds commits by what they changed, who made them, or their message.

When to use it

To find when a line or word came in or went out.

Example

$ git log -S "TODO" --oneline

Show commits that added or removed the word TODO.

$ git log -G "phone|Call" -p

Show commits whose changed lines match, with their changes.

$ git log --author=Aisyah --oneline

Show only the commits Aisyah made.

$ git log --grep=footer -i --oneline

Show commits whose message says footer, in any case.