Reputation: 5039
I can use git log -G search_term
to show the commits in which a line containing string search_term
was added or removed, but this only shows metadata like the commit message and date, not the actual matching line.
I would like some output like:
some_hash: filename.c: + if search_term == True
Is this possible with the available options in Git without having to write a shell script?
Upvotes: 6
Views: 2417
Reputation: 67177
You could display the full patch along with the log message by using -p
:
git log -G search_term -p
Upvotes: 9