SVN – Ignore contents of a directory

Posted by robbiebow on 17 June, 2009 under geek | Read the First Comment

To ignore the contents of a directory in Subversion, do this:

cd $directory_in_question
svn propset svn:ignore '*' .
svn ci -m "Ignoring anything in $directory_in_question"

This ignores files and subdirectories in the directory and ignores any new added nodes to the directory after the commit. The quotes around the * character ensure this is what happens.

  • Charly said,

    Thanks a lot for Helping out. Very much appreciated. I’ve tried everything from:

    svn ps svn:ignore “./directory_in_question” .
    svn ps svn:ignore “./directory_in_question/” .
    svn ps svn:ignore “./directory_in_question/*” .
    svn ps svn:ignore “directory_in_question” .
    svn ps svn:ignore “directory_in_question/” .
    svn ps svn:ignore “directory_in_question/*” .

    and nothing worked. I’ve also tried the -R option. Maybe I’ve got the syntax wrong. But yours worked perfectly fine.

    Chapeau!

Add A Comment