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
I do the following:
git add *pattern_to_exclude* git diff git reset HEAD .
I know it's not an elegant solution and it sometimes canot be used (eg. if you already have stuff staged) , but it does the trick without having to type a complicated command