Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN just won't ignore a folder, despite propset svn:ignore

Tags:

svn

Take folder files, inside an SVN working copy, running in Linux. The folder was set to be ignored, with the commands:

  • svn propset svn:ignore * 'files'
  • svn propset svn:ignore 'default/files'
  • and a few other combination, all valid AFAIK

However, the setting just doesn't kick it. If the repository is accessed with a dektop client (ie Cornerstone on Mac OS) the folder is correctly reported as ignored.

I am scratching my head real hard here.

Thanks.

The answer that cleared it out for me is in this comment:
If the files are already under version control, they will never be ignored.

like image 995
Gabriel R. Avatar asked Nov 06 '09 17:11

Gabriel R.


3 Answers

If you want to ignore a directory files, you need to svn propset svn:ignore files on its PARENT directory, not the directory itself.

e.g.

# your directory structure is this:
# workingCopy
# workingCopy/parent
# workingCopy/parent/subfolder
# to ignore subfolder do this:
svn propset svn:ignore subfolder workingCopy/parent

Edit

If there are files within this folder that are under version control, Subversion will NOT ignore them even if the folder is ignored. You will need to remove them from version control (i.e. svn delete) and then they will be ignored.

A file being under version control takes precedence over any ignore lists that may include it.

like image 80
Michael Hackner Avatar answered Oct 19 '22 12:10

Michael Hackner


So close.

I think you wanted

svn propset svn:ignore files .

if you execute this in the parent directory of the files directory, it'll be ignored. You won't see the effect until the parent is committed, though. And I'm pretty sure you can't ignore a directory that contains versioned files.

Finally, I always use propedit rather than propset, so I don't lose any current settings.

like image 42
Mark Bessey Avatar answered Oct 19 '22 10:10

Mark Bessey


How are you testing it? If you

svn commit files

Then the ignore isn't checked. If you svn commit ., then the automatic behavior of Subversion will ignore it. (This confused me at one point, too. Subversion assumes you're smarter than the svn:ignore.)

like image 1
mqsoh Avatar answered Oct 19 '22 11:10

mqsoh