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.
| 23-Jun-09 at 5:17 pm | Permalink
Awesome tip, thanks!
Stephane | 23-Jul-09 at 11:26 am | Permalink
And how would one make svn ignore all target directories of a maven multi modules project ?
Jim Barritt | 19-Oct-10 at 1:21 pm | Permalink
!!!!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.