Best practice is to add these sort of rules to a [global gitignore](https://help.github.com/articles/ignoring-files) since they're OS specific.