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:
svn ps svn:ignore "*" .
(under the sample
directory)~/.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?
svn -R propset svn:ignore . -F somefile.txt
Where somefile.txt is a file containing all the svn ignore patterns you want recursively set.
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:
svn:ignore
affects only unversions files. This means, that files and directories already known to SVN will still show up.
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.
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" .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With