Recursive ignoring and not-ignoring with tortoise-svn and with command line svn

61 Views Asked by At

I have a repository with these folders, and where I have these goals:

/temp/           <-- I want svn to ignore this
/**/temp         <-- I want svn to ignore this ('temp' in any recursive folder, i.e. at any depth level)
/bar/**/temp     <-- I want svn to NOT ignore 'temp' anywhere inside 'bar' (at any depth level)

Reading svn:ignore docs, I can't find any syntax that could deal with this problem.

a) Is this doable using tortoise-svn client?

b) What about regular command line svn client?

1

There are 1 best solutions below

5
Friedrich On

Your question contains two parts, 1) how to recursively ignore directories and 2) how to not-ignore a certain directory.

The first issue cannot be solved using Subversion's svn:ignore property as this is evaluated on a per-directory level. Since Subversion v1.8, a svn:global-ignores property is supported which is applied to all subdirectories of a working copy (thanks to user bahrep for pointing it out). Documentation can be found in the Red Bean Book chapter on Ignoring Unversioned Items.

At the root of your working copy, you can

svn propset svn:global-ignores temp .

or set the property using TortoiseSVN.

The answer to your second issue is already hidden in the linked page's title: you only ignore unversioned items. Once you've svn add'ed a file or a directory, it will no longer be ignored. Even if global-ignores or svn:ignore would say otherwise.

By the way, the evaluation of svn:ignore is the same no matter if you're using TortoiseSVN or svn CLI. The interface is different, the underlying functionality is the same.