Exclude Files From Git Commands

To exclude files from Git commands such as git grep or git diff:

git grep foobar -- ':!*.java'
git diff -- ':!*.html' ':!abc.csv'

Works for whole folders as well.

Home | Back to blog

This work is licensed under CC BY-NC 4.0 Creative Commons BY-NC image