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

2

3

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?

Tracitracie answered 14/10, 2019 at 15:54 Comment(0)
T
4

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

svn propset svn:ignore -F .svnignore .
Tracitracie answered 14/10, 2019 at 16:0 Comment(0)
G
1

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
Gaudy answered 14/10, 2019 at 16:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.