-1

I have a situation where I have a different web.config configuration for each branch and I need to merge constantly from branch A to Branch B, however every time I do so, I get the file to be overwritten. I was thinking of having variations of this file for each branch, something like:

dev-Web.config prod-Web.config

Is this possible? Which approach would you take?

kostix
  • 51,517
  • 14
  • 93
  • 176
  • Does this answer your question? [Branching: different config files for release/development](https://stackoverflow.com/questions/9636492/branching-different-config-files-for-release-development) – kostix Mar 02 '20 at 12:56

1 Answers1

0

Here is what we do: Not using web.config for settings that change between environments.

We have separate config files for this, and the application at runtime decides which one to use depending on a settings file (or a registry key - VERY handy for debugging as you just click a .reg file and be done).

Deployment scripts will choose which setting to write out dpending on the environmen name (i.e. use the name of the environment to copy a file with a similar name).

But web.config never changes between 30 or so environments.

TomTom
  • 61,059
  • 10
  • 88
  • 148