Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I really get Subversion to ignore a directory?

Tags:

svn

I would like to make it so that Subversion ignores my NetBeans IDE project configuration directories ("nbproject/") and their contents for all projects all the time. I read in the SVN docs that you can set global ignore patterns in ~/.subversion/config. For example, in my config I have...

### Set global-ignores to a set of whitespace-delimited globs
### which Subversion will ignore in its 'status' output, and
### while importing or adding files and directories.
global-ignores = *.o *.lo *.la .class #*# .*.rej *.rej .*~ *~ .#* 
  .DS_Store *.log nbproject

Despite nbproject being in there, SVN does not ignore it. It shows up in status reports. Any way to prevent that?

The nbproject dir did somehow get into the repo, but I removed it. Even though it's not in the repository and does not contain a .svn dir, SVN refuses to ignore it. Maybe because it was somehow noted in the parent dir's .svn dir?


Update

I just completely deleted it from SVN and the filesystem and recreated the project. Now SVN is respecting the ignore pattern. I don't know why it wasn't before.

like image 421
Ethan Avatar asked May 22 '09 19:05

Ethan


2 Answers

Note that ignore patterns in the config file only take effect when you add things.

If you already have the project in SVN, you need to manually attach the property afterwards.

And if you've got the directory you want to ignore in the repository, you need to get rid of it and clean up before adding the property.

like image 92
Lasse V. Karlsen Avatar answered Sep 20 '22 11:09

Lasse V. Karlsen


I can't reproduce this with svn, version 1.6.2 (r37639): a directory that is not under version control gets ignored as it's supposed to be.

like image 21
Gleb Avatar answered Sep 18 '22 11:09

Gleb