views:

1043

answers:

4

I don't want any directory named build or dist to go into my SVN no matter how deep in the tree it is.

Is this possible? In git I just put

build
dist

in my .gitignore at the root and it recursively ignores. How do I do this with svn? Please don't tell me to do a propset on every parent dir...

+4  A: 

In order to ignore all such files in all repositories, you could add a global-ignores to your per-user configuration file.

On Unix-like systems, this area appears as a directory named .subversion in the user's home directory. On Win32 systems, Subversion creates a folder named Subversion, typically inside the Application Data area of the user's profile directory

See Configuration Options

Unfortunately, there's no per-repository option to do this. It's basically per-user, or per-directory, so the multiple svn:ignores is probably the way to go, as annoying as it can be.

Blair Conrad
I'd rather do it per-repo if i can
Paul Tarjan
Oh, then you're out of luck. As @Kevin Reid says - you've got per-directory or per-user.
Blair Conrad
+1  A: 

add to your ~/.subversion/config or /etc/subversion/config file:

[miscellany]
global-ignores = build dist
jspcal
I'd rather do it per-repo if I can
Paul Tarjan
hmm not sure if there's an easy way to do it per-repo, a pre-commit hook could reject certain patterns, but it's not a complete solution. svn:ignore on each parent dir works, but not recursively. you could swap out your config file with a script when working on different repos, but that's an extra step.
jspcal
+5  A: 

It is not possible to do this. There are only two ignore mechanisms in Subversion, svn:ignore (which is nonrecursive) and global-ignores (which is not specific to a repository).

Kevin Reid
A: 

svn propset takes --recursive as an option, so you can do this, with two downsides:

  1. you have to check out the entire repository (or at least all directories therein), and
  2. you have to remember to set the svn:ignore property whenever you add a new directory
Michael Hackner