asp.net - Two different connection strings for web.config in Git -
i'm new git , i'm migrating project in svn git. way works there dev directory on server , production directory on server. dev , production each have separate database , have different connection string in respective web.config's. i'm going using gitflow workflow i'll merging dev master when changes ready production i'll somehow need have web.config on dev branch have 1 connection string , have separate connection string on production branch. there logical way of doing this?
in asp.net may want web.config transformation. there's web.release.config , web.debug.config in project. can used switch connection string depending on build configuration (build, debug, etc) use build application.
another idea i've run including connection strings in separate file like:
<configuration> <connectionstrings configsource="connectionstrings.config" /> </configuration>
which cause .net load connection strings connectionstrings.config
file. file ignored in version control, , dev version distributed in local development environments, staging version placed on staging server , production 1 stays in production.
there more solutions these out there. i've had decent luck both of these options in smaller gitflow type environment.
Comments
Post a Comment