Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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
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
add comment

Your Answer

 
discard

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.