17

I'm using NuGet and NuGet package restore with SVN. Is there a way to ignore all package directories within the packages folder but still include the repositories.config file?

jpierson
  • 16,435
  • 14
  • 105
  • 149
devlife
  • 15,275
  • 27
  • 77
  • 131
  • 1
    Could you provide the exact directory structure and the part you want to ignore? And include version information of TortoiseSVN you are using? – mliebelt Sep 07 '13 at 09:12
  • 2
    I recommend you accept Jay Harris' answer, I've verified that it is a valid solution and you can ensure he gets the bounty I've placed on your question. – jpierson Sep 11 '13 at 04:22

1 Answers1

37

Do not ignore the Packages directory, itself. You will need this folder to commit your repository config.

  1. Right-click the 'Packages' directory, and add it to Subversion. In the 'Add' dialog, select ONLY the Packages directory and the 'repositories.config' file.

  2. Right-click the 'Packages' directory again, and this time bring up TortoiseSVN Properties.

  3. In the Properties dialog, select New... -> Advanced.

    Properties Dialog

  4. In the Advanced dialog, set the property name to 'svn:ignore' and the value to '**'.

    enter image description here

  5. Done. Commit.

The ** ignore setting causes all files and subdirectories to be ignored. However, since repositories.config is committed, it overrides the ignore settings for just this file. The config file will be tracked, and any modifications noted.

Community
  • 1
  • 1
Jay Harris
  • 9,935
  • 1
  • 26
  • 27
  • Excellent, I'll try this out soon and get back to you on an issues I run into. One question however is what is the significance of double start "**" over using just *? I cannot find any reference to ** in the documentation. – jpierson Sep 08 '13 at 06:06
  • 1
    Double Asterisk is a recursive wildcard to search all descendent sub-folders. Single asterisk will only hit the first subfolder. More: http://stackoverflow.com/questions/3529997/unix-wildcard-selectors-asterisks – Jay Harris Sep 10 '13 at 19:29
  • So correct me if I'm wrong but * would match all the sub-folders and thus since they would be ignored there would be no reason to worry about possible sub-folders given that subversion doesn't allow versioned items that don't have their parent folder versions. So for this particular example * would only be needed but as a generally convention with this technique where you have a hierarchy that you want to exist that bypasses the svn:ignore property then ** would be a good idea as a general convention. – jpierson Sep 11 '13 at 04:19
  • 3
    Yes. * should work just fine for SVN. I use mix of source control systems (depending on the project & client), so I use ** to keep it consistent across all systems. But in SVN, * would work just fine. – Jay Harris Sep 12 '13 at 17:45
  • Awesome! I'll try this when I get home! – devlife Sep 12 '13 at 20:23
  • It worked for me, thank you. I've already voted up your answer and would have selected as the preferred answer if I owned the original post. – jpierson Sep 26 '13 at 19:03
  • Sorry it took me so long to get around to marking this as the answer. Thanks! – devlife Dec 30 '13 at 04:20