What is a good git practice to denote that a changed file should never be committed?
For example, for a WordPress theme development project, I am tracking the original WordPress files in git; and the wp-config.php config file, which contains local info that only pertains to the current system, needs to be changed but I don’t want to commit it to git.
In Perforce, I used to save this type of event as a numbered changelist and never check it in. I was wondering whether a similar trick is available with git.
If you still want to keep
wp-config.phpversioned, but ignore any local change to it:This is different that a .gitignore, which would only work if you remove first
wp-config.phpfrom the index: