Ignore certain file from pending changes

2019-04-06 13:44发布

Here is my problem. I have a certain files from the solution (let's say Web.config) that I've changed and will never want to check-in since the changes are referring to my machine only. Is there a way to say in TFS to ignore changes in a certain file and remove it from pending changes window. Of course, I can skip this file in every check-in, but there is always a change to forget and check-in by mistake. For example, there is a similar ignore list in AnkhSVN.

7条回答
等我变得足够好
2楼-- · 2019-04-06 14:25

Some parts of {app,web}.config files can be delegated to another file. Notably <connectionStrings>.

In your app.config or web.config:

<connectionStrings configSource="LocalConnectionStrings.config" />

in LocalConnectionStrings.config have (<connectionStrings> is the root element):

<connectionStrings>
    <!-- For the application's operations. -->
    <add name="Application"
         connectionString="Data Source=server;Initial Catalog=database;Integrated Security=True;Network Library=dbmssocn"
         providerName="System.Data.SqlClient" />
</connectionStrings>

Thus each developer has a LocalConnectionStrings.config which is in the project, but not in source control set with their private settings while the {web,app}.config has shared settings. Unfortunately this only works with a limited set of system defined configuration elements.

查看更多
登录 后发表回答