Internet Bandaid   [RSS Feed]

Svn Ignore Directory

without comments

This is a note-to-self.    Sometimes when I want svn to ignore a whole bunch of files in a directory (example, I want svn to ignore files in my ./user_upload/ directory), I should follow the instructions below, which came from another forum.


$ svn mkdir spool
$ svn propset svn:ignore ‘*’ spool

—-

The value of svn:ignore is the list of file patterns to
ignore. See:

http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.3

So you have two options, depending on whether you want the spool
directory itself to be in version control and have its contents
ignored, or whether you want the directory itself ignored as well.

If you want the former, create the directory, add it, then set the
svn:ignore property of that directory to ‘*’ to ignore everything in it.

$ svn mkdir spool
$ svn propset svn:ignore ‘*’ spool
$ svn ci -m ‘Adding “spool” and ignoring its contents.’

If you want the latter, do not add the directory, but rather set the
svn:ignore property of the parent directory to ‘spool’.

$ mkdir spool
$ svn propset svn:ignore ‘spool’ .
$ svn ci -m ‘Ignoring a directory called “spool”.’

If you had already added the spool directory but now realize you did
not want to, but want to preserve its contents, you can fix it this way:

$ svn export spool spool-tmp
$ svn rm spool
$ svn ci -m ‘Removing inadvertently added directory “spool”.’
$ mv spool-tmp spool
$ svn propset svn:ignore ‘spool’ .
$ svn ci -m ‘Ignoring a directory called “spool”.’

Written by John Lai

September 1st, 2009 at 10:52 am

Posted in Uncategorized

Tagged with , ,

Start Mission - Project management and invoicing

Leave a Reply