There are multiple strategies to handling environment-specific parameters. The best solutions involve modifying the build process so that "local" config files aren't stored in source control.
For example, you could store a template for the config file and have your build process read a property file to determine the final values to be interpolated into the template. The values for shared environments (prod, qa, dev) could be stored on the build server and/or in source control separately from the template. Your local values would be in a property file you maintain, though a "default" file for that purpose could certainly be kept in source control (with the intent that you copy and modify it, to avoid accidentally posting your local changes to the default file).
If you can't get that sort of change implemented? Well, people are forever coming up with solutions based on stash, or modified flags in the index (skip-worktree, assume-unchanged). I generally recommend against these as they all have shortcomings to the degree that they "might work sometimes". But in the absence of being able to make this a build problem, that may be the best you can do.