TFS keeps another copy of the file locally

I am part of a small team developing a web project in VS2013 with TFS2010 for source control.

When we work from home, like everyone else from time to time, we need to have a slightly different version of the web.config file. Previously, when we used VSS, we could just read / write the file, which allowed us to keep a local copy that did not make it into the original control. TFS is too smart to allow us to do this with the inevitable result that sometimes someone accidentally checks the wrong version.

Can anyone suggest us a good way to deal with this problem?

+3


source to share


1 answer


There is an answer here that might work for you using a .tfignore

.

However, you might not want to exclude web.config entirely, as it might be useful to split the appsettings section between your command, and you might prefer to exclude only the connection strings section. If so, you can only use the external config file for your connection strings and then exclude that with the method .tfignore

.

This means that your web.config will contain something like this:

<?xml version='1.0' encoding='utf-8'?>
<configuration>
    <connectionStrings configSource="connections.config"/>
</configuration>

      



and your (excluded) connection.config file will look like this:

<connectionStrings>
    <add name="Name" providerName="System.Data.ProviderName" connectionString="xxx" />
</connectionStrings>

      


Edit . I just noticed that you mentioned TFS2010, so the method is .tfignore

not a parameter (unless you are upgrading to TFS2012 or higher). Here's an answer that supports TFS2010 using the Denied Templates Policy, which should work for you if you can install Power Tools TFS.

+3


source







All Articles