Imagine you have a bunch of Java files ( *.java ). They are collected in *.class files. Compiled *.class files should not be stored in Subversion.
Now imagine that the developer, who created a bunch of new *.java files, compiled them, was pleased with the results, and did this:
$ svn add *
In this case, Subversion will be fun to add *.class to all compiled files. Not what you want ...
The svn:ignore property is located in the directory in which you want to ignore files. If and only if the file is not already in Subversion, the file will not be displayed if the file matches the svn:ignore glob template in the file, and the user makes svn status or svn add with empty cards.
With the svn status these files will not be displayed with a mark ? at the beginning of lines of output. If a user tries to add using a wildcard, Subversion will ignore these files.
In the above scenario, if the developer did this:
$ svn add *
The svn:ignore property will prevent the addition of *.class files.
However, if the user specifically adds an ignored file:
$ svn add foo.class
Subversion will then not ignore the file. And, as soon as it is added to the repository, Subversion will report it if the file is modified or deleted.
The svn:ignore property is displayed to all users who have checked this version of the directory. This is a great way to prevent files from being added accidentally, but that can't stop someone from actually adding them.
I have a pre-commit hook that can take a step forward. With it, you can prevent users from adding specific files to the repository. You can also force users to install svn:ignore when creating a new directory.