Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is SVN global ignore recursive?

Tags:

svn

I am new to SVN, and I want to ignore a directory recursively, like in Git. I have a directory, sample, which I want to ignore recursively.

>svn status
sample/first/1.jpg
sample/second/2.jpg
sample/third/3.jpg

I have tried:

  1. svn ps svn:ignore "*" . (under the sample directory)
  2. Setting global ignores in ~/.subversion/config as global-ignores = sample.

But still it shows the same result when I run svn status:

>svn status
sample/first/1.jpg
sample/second/2.jpg
sample/third/3.jpg

How can I recursively ignore a directory in SVN?

like image 621
Soundar Rathinasamy Avatar asked Sep 29 '11 15:09

Soundar Rathinasamy


3 Answers

svn -R propset svn:ignore . -F somefile.txt

Where somefile.txt is a file containing all the svn ignore patterns you want recursively set.

like image 59
Edwin Buck Avatar answered Sep 20 '22 06:09

Edwin Buck


If you want to ignore the directory samples and all the content within, you must set svn:ignore in the directory containing the samples directory. You did it within samples itself. Please note two things:

  1. svn:ignore affects only unversions files. This means, that files and directories already known to SVN will still show up.

  2. svn:ignore settings are not cumulative or recursive. If you want to ignore only the *.jpg files in you treee, you have to set svn:ignore to *.jpg in each directory.

Please note, that the command svn propset has an -R (aka. recursive) option, which might help. But keep in mind, that propset is not propadd. This is of course only a concern if you want to set different values in the tree.

like image 38
A.H. Avatar answered Sep 23 '22 06:09

A.H.


There is a new SVN property to do this from SVN 1.8 onwards. See the bottom of this page from the SVN book:

svn:global-ignores

It applies to the folder you set it on and everything underneath, and you do not need to specify recursive. For example, to set on the current directory:

svn propset svn:global-ignores "bin obj" .
like image 36
markmnl Avatar answered Sep 20 '22 06:09

markmnl