Environment files in source control are a big No No. Environment files are a big No No anywhere. Period. Except one place - where they are used. You should ONLY maintain ONE local environment file. You should only store in source that one file that is needed to run the code locally.
If you have a config.DEV, config.TEST, config.PROD, etc. YOU ARE WRONG! Stop this, you are causing yourself more pain! Every time you update one value, you have to update it in several places. You are violating DRY (don't repeat yourself).
Well then, how do you get the files? You have to have them somewhere right? Yes you do. The answer to that is to either create them with your automated build script or to update your local file with the deployment script. One gives you the benefit of seeing them in the build folder (but adds additional work to the scripts to deploy the right one), the other gives you the benefit of updating the one file on the way out to the environment with less total build and deploy steps (but you have a point between build and deploy to verify that the script is working right before deployment). Either way, both of these are a better answer to less maintenance and pain.
I have experience with the pain of maintaining multiple environment files. I have experience with one answer. I can tell you that if it saves time and is less prone to error, it is a better answer (but not necessarily the best answer). And the better answer is the one you should choose 9 times out of 10 (because there is always an edge case).
In short, Just say NO! to environment files.
I have a post coming soon on how you do this with configuration files (or any XML file). I will challenge you to the fact that you DO NOT need more than one file and that you can make changes on the way out.