Alex Rivera | Logout

Why does 'svn ignore' not ignore?

Asked 2009-09-21T01:18:09.947
11

I'm trying to add a Linux kernel to an SVN tree, which has a .git subdirectory - which I don't want to add.

Can anyone explain this behaviour - why does it NOT ignore the .git directory?

test2$ mkdir -p a/.git/blah
test2$ ls
a
test2$ svn propset svn:ignore .git .
property 'svn:ignore' set on '.'
test2$ svn propset -R svn:ignore .git .
property 'svn:ignore' set (recursively) on '.'
test2$ svn add a
A         a
A         a/.git
A         a/.git/blah
Edit
Report

1 Answer

17

The svn:ignore property on a directory lists the names in the current directory that will be ignored. You have set the svn:ignore property on your current directory to .git, but that does not apply to the subdirectory a. What you can do is first add a non-recursively:

svn add -N a
svn ci -m "add a directory"

Then set the svn:ignore property:

svn propset svn:ignore .git a

and then add your tree:

svn add a

This should ignore the a/.git directory.

answered 2009-09-21T02:48:49.817

Your Answer