1

I'm using Subversion on Unix-based systems.

In my current working directory, the subdirectory ./tmp is managed by Subversion. I would like all contents under ./tmp to be ignored by subversion.

To phrase it another way: When a user does svn checkout project/tmp, I want them to have the directory ./tmp in their directory. When that same user does svn stat, I want svn to ignore their temporary files under ./tmp without affecting other directories like ./doc and ./foo.

% svn stat
?       foo/bar.tar.gz
?       tmp/foo.example.org
?       tmp/host.log
?       tmp/getscript.vba
?       doc/Manuals/Nagios
?       doc/Manuals/3ware
?       doc/Manuals/markdown

I know that global-ignores can be used to ignore patterns like global-ignores = *.o *.lo *.la *.al *.swp *old .Trash, but can it ignore all files under a given directory? I have tried adding /tmp/* tmp/* */tmp/* to global-ignores to no avail.

Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186

1 Answers1

3

You should be able to use svn propset svn:ignore '*' ./tmp which will set the per-directory ignore glob in the ./tmp directory. Be sure you quote the * or else your shell will replace it with whatever files are in the folder you're in now.

DerfK
  • 19,493
  • 2
  • 38
  • 54
  • This works great. Is this possible to set in `~/.subversion/config`? – Stefan Lasiewski Oct 15 '10 at 17:55
  • 1
    Not that I can figure out, since this is a property of a specific directory in a specific repository. If you want this to apply to every tmp folder in every project anywhere, it might be possible through the auto-props feature but all the documentation I have on that talks about files, not directories, and autoprops are only used on `add` and `import` commands, so they would not help on existing repositories. On top of all that, a setting in ~/.subversion/config would only apply to you, svn:ignore applies to everyone. – DerfK Oct 15 '10 at 21:43