Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I ignore a file/directory with a space in it with a (tortoise) SVN ignore pattern?

I'm trying to add the directory with a space in it:

Static Debug

to my SVN ignore pattern.

However, spaces are used to separate different directories (so the above ignore pattern would be interpreted as two files to ignore -- Static and Debug)

I've tried adding

Static%20Debug

and

"Static Debug"

and

Static\ Debug

with no luck

And apparently I can't ignore by regular expression.

Anyone have any idea?

like image 606
Doug T. Avatar asked Jul 27 '11 15:07

Doug T.


People also ask

How do I ignore a file in svn?

You can ignore a file or directory like . gitignore. Just create a text file of list of directories/files you want to ignore and run the code below: svn propset svn:ignore -F ignorelist.

How do I ignore target folder in svn?

To ignore files in subversion you want to set the svn:ignore property. You can see more here http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.ignore.html about half way down. svn propset svn:ignore target . svn propedit svn:ignore .

What does TortoiseSVN cleanup do?

This is a fast and easy way to remove all generated files in your working copy. All files and folders that are not versioned are moved to the trash bin. Note: you can also do the same from the TortoiseSVN → Revert dialog. There you also get a list of all the unversioned files and folders to select for removal.


2 Answers

I found this documentation in the tortoise manual. According to it

[...]

Matches any one of the characters enclosed in the square brackets. Within the brackets, a pair of characters separated by “-” matches any character lexically between the two. For example [AGm-p] matches any one of A, G, m, n, o or p.

So I can simply do

Static[ ]Debug 

which works

Ok that actually DOESN'T WORK for whitespace in my version of Tortoise

What works is using

?

Matches any single character.

which lets me do

Static?Debug

which unfortunately also matches stuff like StaticADebug. But this is good enough to do the trick.

like image 33
Doug T. Avatar answered Oct 04 '22 00:10

Doug T.


Related to Doug T.'s Answer, I played around with this a bit.

Instead of using ?, you can specify an exclusion range with [] by putting a ^ at the front.

ignore[^A-Za-z0-9]this

If I have an "ignore this" and a "ignore0this", the one with the space will be ignored, but not the one with the 0.

like image 142
crashmstr Avatar answered Oct 04 '22 01:10

crashmstr