Can I ignore files locally without polluting the global git config for everyone else? I have untracked files that are spam in my git status but I don\'t want to commit git c
You can install some git aliases to make this process simpler. This edits the [alias] node of your .gitconfig file.
git config --global alias.ignore 'update-index --skip-worktree'
git config --global alias.unignore 'update-index --no-skip-worktree'
git config --global alias.ignored '!git ls-files -v | grep "^S"'
The shortcuts this installs for you are as follows:
git ignore config.xml
config.xml — preventing you from accidentally committing those changes.git unignore config.xml
config.xml — allowing you again to commit those changes.git ignored
I built these by referring to phatmann's answer — which presents an --assume-unchanged version of the same.
The version I present uses --skip-worktree for ignoring local changes. See Borealid's answer for a full explanation of the difference, but essentially --skip-worktree's purpose is for developers to change files without the risk of committing their changes.
The git ignored command presented here uses git ls-files -v, and filters the list to show just those entries beginning with the S tag. The S tag denotes a file whose status is "skip worktree". For a full list of the file statuses shown by git ls-files: see the documentation for the -t option on git ls-files.