svn:ignore propset
SVN users who wish to ignore multiple files with distinct names in the same folder beware : you must use a file and batch-process.
It’s not difficult to figure out that to tell SVN to ignore a file, you use:
svn propset svn:ignore [filename] [folder]
So if I have a file ‘config.php’ in folder config, in the config folder I would simply type
svn propset svn:ignore config.php .
But what if I also have another file, say ‘database.php’, in the same folder that I want to ignore? On top of that, what if I have other files with a .php extension that I don’t want to ignore? The following will not work:
svn propset svn:ignore “config.php database.php” .
(incorrect syntax)
svn propset svn:ignore “*.php” .
(but i don’t want to ignore some .php files)
nor would the following, because svn for some odd reason seems to only take one propset assignment from the commandline - meaning only one of the files will be ignored:
svn propset svn:ignore config.php .
svn propset svn:ignore database.php .
turns out you must make a file with the filenames on separate lines, then call with the -F parameter. For example in the above case, I would create a file “ignore.me” with config.php and database.php on separate lines, then call
svn propset svn:ignore -F ignore.me .
Annoying. SVN should let you set the same property on multiple files with multiple command-line calls.


December 18th, 2007 at 2:26 am
Thank you for this. This was not very intuitive at all! No mention of this in the svn book that I could find…
April 2nd, 2008 at 8:13 pm
You can insert multiple lines from the commandline, just press enter inside the quotes:
$ svn propset svn:ignore ‘config.php [enter]
> database.php’ . [enter]
May 7th, 2008 at 2:30 am
Massimo32, this was the key I was looking for…how to add a newline in between arguments.
Thanks!!
May 13th, 2008 at 8:45 pm
You can also try this in a shell script called with a space separated single quoted list, eg ‘qwe.txt asd.pid’:
svn propset svn:ignore “`echo “$1″ | tr ‘ ‘ ‘\n’`” .
May 16th, 2008 at 6:27 am
It seems that using \n to embed a newline character in the property string should work to set svn:ignore to multiple files, but it does not.
July 17th, 2008 at 6:01 am
Don’t bother with propset… use propedit
svn propedit svn:ignore .
will bring up your editor, and you can add the rules directly.
It also avoid the potential confusion caused by expansion of ‘*’