Today I came across a problem where someone had accidentally committed a proj.user file to the SVN repository. When i came to update, it obviously caused issues.
It got me wondering if there was any way that you can block certain file extensions to be committed to the repository.
I do realise there is an ignore list but as far as I am aware this still relies on the person to add the files to ignore list. Ideally I would like to control this centrally so that the repository rather than the person has control.
Is this possible?
Yes, in general there are two ways. Either create commit-hooks (which is probably not what you want to do), or, more easily, add the svn:ignore property to your directory. Since properties are maintained along with the project, this will effect everyone. For instance, to ignore
*.userfiles, you could add this to the directory where they would appear:Then commit your change as usual. From now on, *.user files in that directory will no longer participate in svn commands such as stat, update, commit and so forth. You do have to add the property to each directory that requires an ignore field, however. It does not automatically act recursively on your project tree. If, for any reason, you do want to update an ignored file, you would pass the
--no-ignoresflag to the command.