Aka. Best practice to have version control on files that are in my ignore config (e.g. gitignore).
Hi, this question may seems weird first but let me explain: We have quite some ignored config files in our projects. They get brought to the developer by checked in .dist
versions of the config, as this is a well known workflow. (Configs contain dev specific, sometimes sensitive, information that should not be committed.)
Now what I would like to have are the local advantages of version control on those files, too. I want to see what I changed. I want to be able to revert back or stash changes. All without pushing to any remote of corse.
Specific working examples:
- A dev accidentally adding a random character somewhere in the config and has a hard time finding "Why this stopped working, I didn't change anything."
- Trying out config changes and don't want to clutter comments everywhere; using Ctrl+Z all the time and hoping at the end that the appropriate differences exist.
All I came up with was mixing in a different version control system. Or temporarily adding the files to my git and redoing that again, once I am done. Both feel wrong.
Did you ever though about that or use something to prevent mentioned problems?
UPDATE:
Thanks for existing answers! I would like to not have to have separate folders and I would like to have the version control system recognize "new" (but ignored) files by itself.