Private gitignore with .git/info/exclude
While .gitignore is great for team-wide ignore patterns, sometimes you need to ignore files just for your local setup without affecting other developers. Instead of modifying the shared .gitignore or creating a global ignore file, you can use .git/info/exclude.
This file works exactly like .gitignore but is private to your local repository and won't be committed or pushed to remote. 
Example:
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
Makefile
This keeps your ignores clean and avoids polluting the shared .gitignore with personal preferences.