Some projects may have files that should be skipped in Git diff
but still show in Git status
(and be tracked). This can be made possible with a custom diff driver that uses a no-op command.
Adapted from StackOverflow - @KurzedMetal.
Create a global no-op diff
command driver with the following command. Note that driver can be limited to local respository by removing the --global
flag.
git config diff.nodiff.command /bin/true
Assign the new diff
driver to files that should be ignored in the repository .git/info/attributes
file.
*.asset diff=nodiff
# Example with other attributes
*.asset diff=nodiff merge=unityyamlmerge eol=lf
A committed .gitattributes
file may be used to share modified attributes with other developers; however, they will also need a custom nodiff
driver!