Cannot ignore files in Subversion with an external `.svnignore` file

472 Views Asked by At

I need to exclude some files from Subversion, using a .svnignore file:

> more .svnignore

*.obj
*.abc
*.aaa

> touch f1.cpp
> touch f2.abc
> svn add --force ./
A    f1.cpp
A    f2.abc

Why is f2.abc added to the repository, even if its extension should not allow that?

2

There are 2 best solutions below

0
Pietro On

After modifying .svnignore, I had to re-run:

svn propset svn:ignore -F .svnignore .
0
Lazy Badger On

In order to remove possible misinterpretations of Pietro's self-answer

It's obvious, that in SVN it's not enough to put file .svnignore or something like this in the root of you repository folder, unlike Hg or Git, because only relevant properties of files or dirs have effect.

But, because command svn propset have option -F for reading patterns from external file (and setting new properties remove all old), you can use (any text) file for updating ignore-patterns in the whole repository in one action

In order to mimics Git|Hg style of ignoring more deeply, everybody (with Python) can install and use SVN-Ignore from Pypi, which add

  • A .svnignore file that lets you specify which files should be ignored
  • The possibility to add exceptions(Lines starting with !) to the SVN Ignore file
  • Updating the svn:ignore property every time you add new files