I have a config file in our project that holds a connection string to the database, as well as several application settings, e.g:
...
Let me put some suggestions on how this might be done.
When adding changes to the index you can use git add -p app.config and manually skip some of the changes in your file. If you don't add changes to the index before doing commit these changes would not be committed. This is a kind of 'local-only' solution. But it might be really boring to always see the file modified in git status report.
All other suggestions might require changes in the architecture and there for can not be considered as 'local-only' solution. Anyway I think they might worth reviewing.
The main idea for all changes is to have local file added to .gitignore which contains local system specific settings. We have used several slightly different solutions here.
app-original.config file in git repository and app.config file in git ignore list. The app.config file should be created manually from app-original.config file.What is really boring with all these solutions is that some manual work is required when the structure of config file is altered. For example on every config file update you should check if new properties have been introduced and update your local properties file. As well when you update your local file because of some application changes you need to remember to commit related changes in configuration files (remember your local files are in .gitignore).