svn ignore on the command line

How to ignore files on command line with subversion.

I’ve had to google this so many times I thought I would post it.

svn propedit svn:ignore ./some_path

You need this if you want to ignore more than one pattern.
Will open a text editor where you can add multiple entries.

You can also do:

svn propset svn:ignore -F file_to_ignore ./some_path 

The -F means ignore a file.

for example:

For directory target

svn propset svn:ignore target .

ignores the target directory in the current dir.

You have to remember to commit the directory you have just set the property on:

svn ci -m "Setting the ignore property to ignore target directory" -N .

The -N means non-recursive so just commit the current directory.

Share

3 thoughts on “svn ignore on the command line

  1. And how would one make svn ignore all target directories of a maven multi modules project ?

  2. !!!!WARNING!!!!!! this does it to ALL the sub directories, so its probably better to script something up to just do it for the individual module roots.

    Oops, missed this for a year! You can set -R as a flag to the svn propset command which will recursively apply the ignore.

    So you could do:

    svn propset -R svn:ignore target .

    !!!!WARNING!!!!!! this does it to ALL the sub directories, so its probably better to script something up to just do it for the individual module roots.

Comments are closed.