In a word: You can't...
However, if you already have packages.config
in your repository, then it won't be ignored even if svn ignore is set to *.config
. You can't ignore stuff already in the repository.
However, from what you want, it sounds like you can use my pre-commit hook for finer control over your situation. My hook takes a list of rules specified in a control file. For file rules, the last rule that matches the file's name is the access they're granted. In your situation, you would have two rules:
[FILE Configuration files must be named "packages.config"]
file = **/*.config
access = no-add
users = @ALL
[FILE Configuration files must be named "packages.config"]
file = **/packages.config
access = read-write
users = @ALL
If someone tried to add bob.config
, to the repository, my first rule is in effect. bob.config
matches *.config
, and that rule says you can't add any files that end in .config
.
However, if someone tries to add packages.config
to the repository, it will work because although packages.config
matches the first rule and the first rule prohibits it, packages.config
also matches the second rule which allows it. The second rule wins over the first rule.
As a bonus, my pre-commit hook will prohibit adding in bob.config
even if the user tried to ignore the ignore (which users are free to do).