Probably some of these scenarios could be solved with other approaches, like writing
.user config files, but a solution that solves all of these issues is using the
update-index command of Git.
You can type
git update-index --assume-unchanged <file> to temporarily exclude the file from any tracking, pretending it never changed. When you actually need to commit an actual change to the file, you can use the opposite command,
git update-index --no-assume-unchanged <file>.
The only problem is that I cannot find a way to list which files are untracked. However, it nicely solves the problem of making configuration changes that we don't want to commit in a way that is transparent for the solution being developed.
Have you ever used this approach before? What do you think? Let me know in the comments.