git grep by file extensions

Solution 1:

Yes, for example:

git grep res -- '*.js'

Solution 2:

Try doing this :

find . -type f -iname '*.js' -exec grep -i 'pattern' {} +