1

Is there a way, similar to Github's abilities, so search for code in Git history subsetted to within certain folders? https://help.github.com/articles/searching-code

Another SO question discussed how to search in general, How to grep (search) committed code in the git history?

thank you!

Community
  • 1
  • 1
AnneTheAgile
  • 9,932
  • 6
  • 52
  • 48

1 Answers1

1

This should do it

git log -p -S <string> -- <path>
-p                 Generate patch (see section on generating patches).

-S <string>        Look for differences that introduce or remove an instance of
                   <string>. Note that this is different than the string simply
                   appearing in diff output.

git log

Zombo
  • 1
  • 62
  • 391
  • 407