tfIgnore does not work for me in Visual Studio 2013

后端 未结 6 1410
南旧
南旧 2020-12-05 22:58

I am pulling my hair out with trying to get tfIgnore to work in Visual Studio 2013.

I followed the instructions here: bottom of this artic

相关标签:
6条回答
  • 2020-12-05 23:42

    I had the same issue. I went and found that there is a bug in the NuGet client:

    Ignore Files

    Note: There is currently a known bug in the NuGet Client that causes the client to still add the packages folder to version control. A workaround is to disable the source control integration. In order to do that, you'll need a nuget.config file in the .nuget folder that is parallel to your solution. If this folder doesn't exist yet, you'll need to create it. In nuget.config, add the following content:

    http://docs.nuget.org/consume/package-restore/team-build

    And I was able to get it working by following the work around linked in the "Ignore Files" section above. Here is a snippet of the work around below:

    Respect .tfignore and .gitignore files for TFS Integration description

    When using TFS integration in Visual Studio, NuGet will pend adds to the /packages folder even when there is a .tfignore or .gitignore file in place that says to ignore the /packages folder. NuGet should respect the ignore file rather than requiring that the user create a NuGet.config file that has disableSourceControlIntegration=true.

    This can be done by calling into the LocalItemExclusionEvaluator: http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.localitemexclusionevaluator.aspx

    Before adding items to TFS, we should check this evaluator. We should at least do it for the /packages folder if nothing else.

    https://nuget.codeplex.com/workitem/4072

    0 讨论(0)
  • 2020-12-05 23:43

    I noticed that if you have one file checked in the packages folder, for example repositories.config then the .tfignore pattern doesn't work.

    My solution was to delete the packages folder from source control entirely, then the packages content were successfully ignored

    0 讨论(0)
  • 2020-12-05 23:45

    Looks like someone called "aheidebrecht" is trying to provide a NuGet package to keep NuGet packages from checking into TFS. Seems a bit perverted...

    In package manager console run...

    PM> Install-Package DisableSourceControlIntegration-TFS -Version 1.0.1 
    

    https://www.nuget.org/packages/DisableSourceControlIntegration-TFS

    0 讨论(0)
  • 2020-12-05 23:53

    A bug in NuGet may be causing the problem. This is the workaround:

    1. Create a .nuget folder in your solution folder, if it doesn't exist.

    2. In the .nuget folder, create a file nuget.config with this content:

    <configuration>
        <solution>
            <add key="disableSourceControlIntegration" value="true" />
        </solution>
    </configuration>
    
    0 讨论(0)
  • 2020-12-05 23:55

    In pending changes, right click the root package folder -> click undo. You should see your changes move to the "Detected changes" dialog box, under excluded changes (the window where you can promote files into source control).

    Now, open up .tfignore and simply add packages. You should see that now, when you open detected changes, your packages aren't displayed.

    0 讨论(0)
  • 2020-12-05 23:56

    If the file or folder(s) you want to ignore changes to are checked-in to TFS, then ignoring them in .tfignore won't do anything - you have to remove them from source control first. That way any changes to them will be ignored.

    0 讨论(0)
提交回复
热议问题