3

I have a directory in my application called /admin/debug/output that contains a directory and a bunch of JavaScript files. I want to ignore them completely from appearing when doing an svn st before commiting code.

I used the propset commant like this to ignore it, however it seems to have had no effect:

svn propset svn:ignore admin/debug/output/ . ( I ran this from the root )

property 'svn:ignore' set on '.'

Why does SVN still recognise this when doing an svn st?

crmpicco
  • 16,605
  • 26
  • 134
  • 210

1 Answers1

7

SVN handles ignored directories only for immediate subdirectories and files. Thus, you should set this property for the parent directory, i.e.

$ cd admin/debug
$ svn propset svn:ignore output . 
$ svn ci -m "Adding SVN property to ignore output directory." 

Make sure that output is without trailing slash.

NOTE

If the folder is already under version control, then the following sequence of operation should be applied:

$ svn delete --keep-local output 
$ svn propset svn:ignore output . 
$ svn ci -m "Adding SVN property to ignore output directory." 

if you have old SVN (<1.5) do workaround:

$ cp -rp output output_ 
$ svn rm output 
$ svn propset svn:ignore output . 
$ svn ci -m "Adding SVN property to ignore output directory." 
$ mv output_ output 

OR

You can leave the folder and mark as ignored all files in it:

$ svn propset svn:ignore "*" .
$ svn ci -m "Adding SVN property to ignore all files in output directory." 
pmod
  • 10,450
  • 1
  • 37
  • 50
  • Hmmm, yeah that's exactly what I done. I've just `cd admin/debug/` and then `svn propset svn:ignore output .` and an `svn st` still shows up all the JavaScript debug files. I used output _without_ the trailing slash. – crmpicco Nov 05 '12 at 20:04
  • Is that folder under version control? and how it's marked on output of svn st? – pmod Nov 05 '12 at 20:12
  • Yes, the `/admin/debug/output` directory is under version control. When doing an `svn st` both `admin/debug/` and `admin/debug/output` show as `M` (modified). All JavaScript files under those directories show as unrecognised, `?`. – crmpicco Nov 05 '12 at 20:18
  • So, you should set that folder out of version control (with svn delete = see http://stackoverflow.com/questions/9317600/deleting-a-folder-from-svn-repository) and do svn update, but should be done before setting the ignore property – pmod Nov 05 '12 at 20:25
  • I see what you're saying. Can't I have the _folder_ under version control, but have the files within the folder ignored? Or is that possible with SVN? – crmpicco Nov 05 '12 at 20:29
  • 1
    You can ignore all files in a directory - see http://blog.alastairdawson.com/2007/02/21/how-to-ignore-all-files-in-a-directory-folder-with-subversion/. But this is a bit weird IMO. – pmod Nov 05 '12 at 20:54
  • That's exactly what I was looking for. Thanks. Do you want to edit/update your answer and I will happily accept. – crmpicco Nov 05 '12 at 20:57