Is SVN global ignore recursive?

I am new to SVN and I want to ignore the directory recursively, as 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 tried:

  • svn ps svn:ignore "*" . (in the sample directory)
  • Set global ignore to ~/.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?

+6
source share
5 answers

If you want to ignore the samples directory and all the content inside, you must install svn:ignore in the directory containing the samples directory. You have done this within samples . Pay attention to two things:

  • svn:ignore only affects dev files. This means that files and directories already known to SVN will be displayed.

    Settings
  • svn:ignore are not cumulative or recursive. If you want to ignore only * .jpg files in your tree, you must set svn:ignore to *.jpg in each directory.

Note that the svn propset has the -R option (aka. Recursive), which may help. But keep in mind that propset not propadd . This, of course, is only a problem if you want to set different values ​​in the tree.

+4
source

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

Where somefile.txt is a file containing all svn ignore patterns that you want to install recursively.

+7
source

From http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.advanced.props.special.ignore :

"The patterns found in the svn: ignore property apply only to the directory in which this property is set, and not to any of its subdirectories."

[...]

β€œWhen an object is under the Subversion control, the ignore pattern mechanisms no longer apply to it. In other words, don't expect Subversion to not make the changes you make to the version file, simply because this file name matches ignore the Subversion pattern always notices all its versions of objects. "

You can use the -R flag, but this will only apply the property in a recursive way - it does not change the effect of the properties, therefore it will not apply to newly created directories.

I also suggest using propedit instead of ps because it allows mulitline editing, otherwise it is difficult to deal with more than one ignore pattern.

+1
source

With SVN 1.8 onwards, a new SVN property appears. See the bottom of this page from the SVN book :

 svn:global-ignores 

This applies to the folder in which you install it, and everything below it, and you do not need to specify a recursive. For example, to install in the current directory:

 svn propset svn:global-ignores "bin obj" . 
+1
source

For those on * nix:

Although the documentation implies that ~.subversion/config should already have a default configuration, mine (SVN 1.6.17 on Ubuntu) was empty.

Here the format that I finally started working (this is the whole file) includes the default settings, and I added * .ignore at the end:

 [Miscellany] global-ignores=*.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.ignore 
0
source

Source: https://habr.com/ru/post/898296/


All Articles