Get TFS to ignore my packages folder

前端 未结 12 2561
抹茶落季
抹茶落季 2020-11-28 00:22

I\'m trying to get TFS (2013) to ignore my packages folder. I passionately don\'t want it source controlled as I\'m using NuGet and it\'s great!

I\'ve t

相关标签:
12条回答
  • 2020-11-28 00:50

    Terje's answer doesn't work all the time for me, sometimes it will work for a while, but then it will pend a load of "adds" for me all over again.

    The only way I have found to solve this permanently is to Cloak the packages folder in my Workspace.

    For example:

    Type      Server                Local
    ============================================
    Active    $/Work/Main           C:\Code\Main
    Cloaked   $/Work/Main/Packages
    
    0 讨论(0)
  • 2020-11-28 00:52

    Add a nuget.config file in a .nuget folder in your solution. Add the following to the nuget.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <solution>
        <add key="disableSourceControlIntegration" value="true" />
      </solution>
    </configuration>
    

    The disableSourceControlIntegration is what makes the trick for TFS Version Control.

    0 讨论(0)
  • 2020-11-28 00:52

    The solution that worked for me was to create both a .tfignore and the following setting in the Nuget.Config:

    <configuration>
      ...
      <solution>
        <add key="disableSourceControlIntegration" value="true" />
      </solution>  
      ...
    </configuration>
    

    My .tfignore contains this line:

    \packages
    

    [I'm using Visual Studio 2015 Update 2]

    This is not ideal, and is currently logged as an open issue on github/nuget:

    Make it easier to omit packages from TFVC #493

    0 讨论(0)
  • 2020-11-28 00:54

    You need to be using local workspaces for .tfignore to work. The .tfignore file must be in the folder that contains the files or folders you want to ignore.

    So if your solution structure looks like this:

    \Project
       \Packages
       \OtherStuff
       foo.cs
    

    You'd put your .tfignore file in \Project:

    \Project
       \Packages
       \OtherStuff
       foo.cs
       .tfignore
    

    The contents of the .tfignore in your case would be:

    \packages

    Here's some documentation for you: http://msdn.microsoft.com/library/vstudio/ms245454(v=vs.110).aspx#tfignore

    0 讨论(0)
  • 2020-11-28 00:54

    I had the same issue. /packages should work but didn't for me. packages*.* did work.

    0 讨论(0)
  • 2020-11-28 00:55

    If you are using Git with TFS you need to add a ".gitignore" file. You can do this in "team project | Settings | 'add ignore file'". Then open the file and uncomment the built in ignore statement for Nuget Packages.

    If you are using TFVC and you have Local Workspaces configured you can use the ".tfignore" file that honours an identical format to the Git file. I think you need "packages/".

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