Git search for string in a single file’s history November 26, 2022 by Tarik For this purpose you can use the -S option to git log: git log -S'bar' -- foo.rb