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 :
- -Gwill list all commits where- specific_textappears in the diff,
- -Swill only list commits where the count of- specific_textchanges, 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