Those files are specific to your own machine/setup. You should indeed ignore them.
However, you should not simply add entries corresponding to those files in the project's .gitignore
. Instead, you should ignore those files via a global .gitignore
:
git config --global core.excludesfile <path-to-global-ignore-file>
Why not just add entries in the project's .gitignore
? Remember that this file is going to be used by all collaborators in the project, so you want to keep it clean and tidy; adding user-specific entries to a repository-specific .gitignore
will just bloat/pollute the latter, and contribute to unnecessary mental overhead.
For instance, imagine that one collaborator, Bob, works on Mac OS X, whereas another collaborator, Alice, works on Windows. Bob probably wants to ignore .DS_Store
files, whereas, Alice probably wants to ignore thumbs.db
files. However, Bob has no need to ignore thumbs.db
files, and Alice has no need to ignore .DS_Store
files. Therefore, they shouldn't inflict a useless gitignore entry on each other. They would do better to ignore such files via a .gitignore
file local to their machines.