We have multiple teams of developers in different offices, and they need different values for a number of configuration setting in our projects\' web.config and
Did you consider a content filter driver?

That would mean, on each git checkout, the smudge script would generate the actual config file based on:
@@A_PARAM_VALUE@@)That avoid any merge issue and gitignore settings: each "config value files" are different and remain separate.
This is also compatible with other config generation solution like ConfigGen mentioned in pms1969's answer.