[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: ignored files

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 20 Dec 2010 11:36:39 +0100

On Sat, Dec 18, 2010 at 09:39:55AM -0800, sajan wrote:
> hi
> is there any way I can avoid adding particular folders/files when I
> add my code to subversion.In git you can do that using .gitignore
> file.
>
> suppose I have this directory structure
>
> mycode
> |----tobeignored1
> |----tobeincluded
> |---tobeignored2
> |---myimage.jpg
> |---tobeincluded2
> |---mylib
> |---lib1.jar
>
>
> here I want to ignore folders tobeignored1,tobeignored2 and file
> myimage.jpg and add the other folders and files .Can someone tell me
> how to do this?

Subversion properties aren't recursive, so the svn:ignore property
only applies to the directory it is set on. And this directory already
needs to be versioned since otherwise the svn:ignore property couldn't
exist. So you cannot use the svn:ignore property.

While adding or importing new directories ("svn import" or "svn add"),
you can only use the global-ignores variable in ~/.subversion/config.
This is not very pretty because you may need to tweak this config
setting every time you do an import. It would be nicer to have an
--ignore-list FILE command line option for "svn add" and "svn import"
which would read ignore patterns from FILE, one for each line.
But that doesn't exist yet.

Also note that ignore lists only affect unversioned files that are picked up
indirectly during directory recursion. Items explicitly named on the
command line will be added even if they match an ignore pattern, be it
from the global list or from svn:ignore.
For example:

global-ignores = *.x

 dir
  |-- foo.x
  |-- bar.y

If you run "svn add dir/*" foo.x will be added.
If you run svn add dir foo.x will not be added.
bar.y will be added in either case.

Stefan
Received on 2010-12-20 11:37:21 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.