1

I have a directory structure that looks like:

components
  |_ticker
    |_sass-utils
      |_ ..
    |_ticker.css
    |_ticker.sass
    |_ ..

There are several files I don't want under SVN version control. components is already committed but ticker is not yet committed and svn status currently states:

?       components/ticker

If I cd into the ticker directory then try: svn propedit svn:ignore . (which is what I tried from this SO solution) I get the error:

svn: E200005: 'components/ticker' is not under version control

I believe that once I svn add components/ticker, files under ticker can no longer be ignored.

So how do I ignore files that are not under version control yet?

Community
  • 1
  • 1
Fisu
  • 3,294
  • 9
  • 39
  • 61
  • possible duplicate of [How to ignore a directory with SVN?](http://stackoverflow.com/questions/116074/how-to-ignore-a-directory-with-svn) – Schwern Jan 15 '15 at 07:22
  • I followed the advice of that answer by doing `svn propedit svn:ignore .` but as stated, I get the `not under version control` error. So something is somehow different in my setup. – Fisu Jan 15 '15 at 07:34
  • That's because you need to set the "svn:ignore" property on the parent directory, and set it to a value matching the directory you want to ignore. – Ben Jan 15 '15 at 15:53

1 Answers1

3

This answer lays it all out.

The problem you're having is you're going into the directory to be ignored (components/ticker) and trying to set properties. You're treating svn:ignore as if it acts on the current directory. svn:ignore is list of sub-directories to be ignored. You need to set the ignore property in the parent directory (components) and give it the sub-directory to ignore (ticker).

cd components
svn propset svn:ignore ticker .
Community
  • 1
  • 1
Schwern
  • 153,029
  • 25
  • 195
  • 336
  • Doesn't `propset` only ignore a single pattern? As I want to ignore multiple patterns, shouldn't I do `svn propedit svn:ignore ticker .`? When I do that from *components*, again I get the 'not under vc' error. – Fisu Jan 15 '15 at 07:53
  • The propedit syntax is `svn propedit `. `svn propedit svn:ignore ticker .` says to edit ticker's properties and then components'. So `svn propedit svn:ignore .` and add "ticker" in the editor. – Schwern Jan 15 '15 at 07:55
  • Now it's making more sense to me, but I don't want to ignore the whole of 'ticker'. So in propedit I add `ticker/ticker.scss` (also tried just `ticker.scss`) but on `svn status` ticker.scss is still listed with `?`. – Fisu Jan 15 '15 at 08:01
  • svn:ignore only works for the immediate items in the directory. If not all of ticker will be ignored, then `svn add ticker`, `svn propedit svn:ignore ticker` and add `ticker.scss`. I suspect you really want `*.scss`. – Schwern Jan 15 '15 at 08:06
  • Doing `svn propedit svn:ignore ticker` I again get the 'ticker is not under version control'. Sorry I have no idea why this isn't working. – Fisu Jan 15 '15 at 08:09
  • What happened when you `svn add ticker`? – Schwern Jan 15 '15 at 08:13
  • I have now done `svn add ticker` now all files under ticker have been added (including all the ones I'm trying to ignore). – Fisu Jan 15 '15 at 08:19
  • @Fisu Sorry, it's been a while since I've used svn, I forgot it's recursive. [Unadd the problem files](https://stackoverflow.com/questions/2882898/subversion-unadd). In the future, `svn add --depth=empty` will stop it from recursing. – Schwern Jan 15 '15 at 21:15
  • 1
    Yes that works, thanks for working it through with me. – Fisu Jan 16 '15 at 05:57