A typical way to do this would be the following:
You save a copy of each file in the repository and name them correctly. For example, if the file is in question web.config , you should save the following two in the repository:
web.server.configweb.dev.config
Then you added the built-in step to ensure the correct file copied to the actual web.config , you can use the batch file:
if "%COMPUTERNAME%" == "SERVER" copy web.server.config web.config if not "%COMPUTERNAME%" == "SERVER" copy web.dev.config web.config
Then you will ignore web.config itself through .hgignore:
glob:web.config
Lasse Vågsæther Karlsen
source share