Lucky for you, git has a ‘grep’ mode that’s perfect for doing a git log search!
Suppose I wanted to search for the string “facebook” in all of the commit messages of my project. All it takes is this one command:
git log --grep="facebook"
and you’ll see all of the log messages which contain the our search term!
Okay, now suppose that you want to search more than just the commit messages, but the commits themselves. Simple! Drop the ‘log’ argument.
git grep "facebook" $(git rev-list --all)
This will show the commit ID and line number of all instances of your string. (The string can also be a regular expression, which is handy if you know regex, too.)
This can be made slightly more human-friendly by using the ‘pickaxe’ feature of git log grep, like this:
git log -S"facebook"
which will show all the commit messages of commits which include your string.
Hope this helped!
Whether you’re looking for some temporary help or your next full time developer, let Gun.io help you find the right person for the job.