To exclude files from Git commands such as git grep or git diff:
git grep
git diff
git grep foobar -- ':!*.java' git diff -- ':!*.html' ':!abc.csv'
Works for whole folders as well.
This work is licensed under CC BY-NC 4.0