I am trying to exclude a file (db/irrelevant.php) from a Git diff. I have tried putting a file in the db subdirectory called .gitattributes>
db/irrelevant.php
db
.gitattributes>
You can also use filterdiff program of the patchutils program collection to exclude some parts of a diff. For example:
git diff | filterdiff -p 1 -x db/irrelevant.php