Still in my early days of using Git. Recently just to make sure that I have merged two branches and have pushed changes to QA server successfully,I often used command “find | xargs grep” .But to deal with this kind of situations Git provides “grep” command. Just as name suggests this commands searches for regex pattern passed to it.
git grep "regex"
Example – To find usage of word “collections” in each file.
git grep --ignore-case "collections"
ReadMe.txt:groovy Collections ReadMe.txt:nice collections
Now this just described which of project files have word ‘list’ in it and how many times.One can also use -c option to count occurrences of word “collections”
git grep --ignore-case -c "collections"
find | xargs grep -y "collections"
git grep --ignore-case "collections" ea145f1