2

I have a Subversion project, and I want to ignore almost all dll files. The only dlls I do not want to ignore are any within folders named "External References".

How do I do this?

Jay Sullivan
  • 17,332
  • 11
  • 62
  • 86
  • Can you just set svn:ignore property for all folders except that one? – pmod Jun 17 '13 at 20:44
  • Are these DLL files already checked into your Subversion repository? You can't ignore files once they're checked into the repository – David W. Jun 18 '13 at 02:06

1 Answers1

2

You need to set special SVN property for those directories where you need to ignore these files. In directories where you need to ignore all .dll files - use this extension. In directories where some files need to be ignored - use their names.

To ignore all .dll files within the current folder:

svn propset svn:ignore '*.dll' .

To ignore some .dll files within the current folder fill the text file and apply:

echo a1.dll > svnignore.txt
echo a2.dll >> svnignore.txt
svn propset svn:ignore -F svnignore.txt .

And after that don't forget to commit changes:

svn commit -m "Ignore some .dll"

Note that it will clear all previous svn:ignore properties set for these folders if any (in this case you should use svn propedit).

If you have a lot of folders on the same level as "External References" and you want to ignore everywhere except this particular folder, just loop through dirs excluding this one and set this property. E.g. for linux (from parent dir):

for d in `ls -Ad | grep -v "External References"`; do svn propset svn:ignore '*.dll' $d; done;
pmod
  • 10,450
  • 1
  • 37
  • 50
  • This sounds like I'm going to have to update this every time I add a folder. Is there no way to set a convention, such as "don't ignore files with 'ExternalReferences' in their path"? – Jay Sullivan Jun 18 '13 at 14:15
  • No way, you need to set it when you create folders.... However if you have really big project, lots of folders you can think of special server hook script which will set this property automatically. – pmod Jun 18 '13 at 18:56
  • This script may also enforce a policy not to allow dll to be committed to all folders except one. But that must be done on server which is not always possible. – pmod Jun 18 '13 at 18:59
  • Thanks, this is the first from google: http://stackoverflow.com/questions/13137023/svn-pre-commit-hook-to-restrict-file-extensions-from-getting-commited You can find more on that... and this will different Question – pmod Jun 19 '13 at 10:30