git grep <pattern>
will search only one commit.
If you want to search all of git's history, use one of the pickaxe options :
git log -G "specific_text" -- frequently/modified/file
# or :
git log -S "specific_text" -- frequently/modified/file
The difference between the two is explained in the docs :
-G
will list all commits where specific_text
appears in the diff,
-S
will only list commits where the count of specific_text
changes, e.g : the commit where this text appears, the commit where it gets deleted, but not a commit which just moves it around, without adding or removing an instance.
You can also add -p
if you want to see the diff itself :
git log -p -S "specific_text" -- frequently/modified/file