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/
This entry was written by
Alastair, posted on
February 21, 2007 at 2:41 pm, filed under
svn. Bookmark the
permalink. Follow any comments here with the
RSS feed for this post.
or leave a trackback:
Trackback URL.
© Copyright 2006 - 2010 Alastair Dawson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
4 Comments
Thank you very much. You made my day
Thanks buddy.. it help me lot.
Thanks! I’ve been trying to do this for ages and this is the first thing I’ve tried that actually worked
!
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?