Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/
?       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.

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
This works great. Is this possible to set in ~/.subversion/config? – Stefan Lasiewski Oct 15 '10 at 17:55
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.