The scenario is as follows. I work on a project that contains a JSON file with the database configuration. Something like:
{
"db_config":
{
"conn_string": "server:localhost;user:db-user;password=db-pass"
}
}
It turns out that I need to change these settings to run the project in my local environment, this is because I use the remote bank on a local server.
The problem is that whenever I change this file with my settings
I need to remember not to add it before commit ; or
I need to remember to change it before commit ; or
I just commit the file and "spoiling" the configuration of all my project colleagues.
Placing the file in .gitignore would cause it to be deleted from the remote repository.
How can I ask to ask GIT to ignore all changes I make to this file? And how can I revert this if I need to change any settings in this file later?