I have a database configuration file that has default values that are unimportant. However, any changes to this file would contain sensitive information that should not be tracked in the repo.
I would like future pulls of the Git repository to include the default version but disregard any changes made by any user.
The following keeps a local configuration but pushes the delete to the repo resulting in issues for future pulls.
cat "app/dir/config.file" >> .gitignore
git rm --cached app/dir/config.file
The following does the job but does not persist past the push to the repo.
git update-index --assume-unchanged app/dir/config.file
This seems like a common requirement for version control around sensitive information but I can't seem to find a solution.