As for Git, I would use a filter driver to build the correct web.config from:
- a
web.config.template file, - external (encrypted) source where you need to look for a password.

On each check, the smudge script will be the correct content of web.config , thus:
web.config remains closed (visible only in the working tree)- the common parts of
web.config that do not change frequently and are publicly available remain versions in web.config.template . - the password, even encrypted, is not replicated from the repository to the repository.
source share