Issue
To search within commits text, we use git log -G SEARCHTERM
. This lists the commit hash and commit message.
Is there a way to show results like with grep, showing the SEARCHTERM
within context?
Solution
A pretty close thing is to add -p
:
git log -p -G SEARCHTERM
When you combine -p
with -G
, git
will only display the files where SEARCHTERM
was found.
For those files, it will display the complete diff though, rather than just the chunks where SEARCHTERM
appeared.
Answered By - LeGEC Answer Checked By - Terry (WPSolving Volunteer)