How to: Ignore all files in a directory (folder) with subversion

The ignore command for subversion can be confusing. Ignoring certain files types is pretty easy:

$ svn propset svn:ignore "*.log" log

but ignoring folders is tricky and was giving me headaches for a while. I was using file_column (in Rails) to save uploaded photos and whenever I did a svn status I would get a list of all my test uploads:

?      public/photo/filename/106
?      public/photo/filename/116
?      public/photo/filename/126
?      public/photo/filename/117
?      public/photo/filename/127
?      public/photo/filename/128
?      public/photo/filename/129

Which made it hard to find files I wanted to add. Here’s how to ignore a directory:

svn propset svn:ignore "*" public/photo/

4 Comments

  1. Posted February 5, 2008 at 6:26 am | Permalink

    Thank you very much. You made my day

  2. Gaurav
    Posted March 25, 2008 at 4:14 am | Permalink

    Thanks buddy.. it help me lot.

  3. James
    Posted November 19, 2008 at 12:45 pm | Permalink

    Thanks! I’ve been trying to do this for ages and this is the first thing I’ve tried that actually worked :D !

  4. dj
    Posted April 30, 2010 at 2:03 pm | Permalink

    Awesome, any idea how would you add this to a prop file though, like an ignores.txt file? I just don’t want to type this every time, and I think if we use the ignores.txt file then it can be shared with other users of the project?

Post a Comment

Your email is never shared. Required fields are marked *

*
*

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word