How to get SVN to ignore directories

As there doesn’t seem to be a Google-friendly, simple guide to this I think I’ll be the one to help out this time…

You need to edit the svn:ignore property file for the containing directory to include the name of the directory you want to exclude.

  1. Navigate to the directory containing the directory you want to ignore.
  2. svn propedit svn:ignore should open up the property file in your favourite editor.
  3. To make SVN ignore a directory, simply enter the name of that directory on one line, on it’s own. For example, to ignore the directory quickedit, I’d just have

    quickedit

    on one line.

  4. Files are different, and you can use a sort-of regex grammar to ignore these.
  5. Save the file (in vi this is :wq)
  6. Now commit this change with:
    svn commit -m "Updating the svn:ignore property file to ignore some directory..."
  7. If you get a message about your checked out copy being out of date (when it shouldn’t, which is what I just got) try executing svn update
  8. And you’re done!

Absesiavose 3rd August 2008

Brilliant!

Leave a Reply