rwallace
rwallace

Reputation: 33515

Git search history and show diff

git log -G searches history for diffs containing an expression, but it only outputs the commit message for each diff found.

Is there a way to do this but also output the actual content of the diffs?

Upvotes: 1

Views: 238

Answers (2)

pqnet
pqnet

Reputation: 6608

use the -p option:

git log -p -G mysearch

Upvotes: 3

Jon Carter
Jon Carter

Reputation: 3436

Well, there's git diff. Try reading the instructions for that (man git-diff).

You could use the commit ids and filenames to compare particular things, a la:

git diff <commit_id> <filename> <other_commit_id> <filename>

That'll show you the diffs of the files given at the time of the commits specified.

Upvotes: 0

Related Questions