views:

251

answers:

5

I thought I'd get myself a Subversion setup at home for my hobby projects, and I'm trying to do it right, first time (my work's source control control policies or lack of them are, well, not perfect).

The thing I'm struggling with is this: I'd like to version entire Eclipse projects. This will be good from Eclipse's point of view - I'll just let it do its thing, and should just mean I need to ignore a few binaries / whole build directories and set up these ignores just once when I set up the project (right?). Anyway, I've tried it a couple of times and svn seems to get confused and ignore my ignore settings. What should be the correct procedure?

Thanks.

PS I'm doing the svn bits from command line, trying to avoid a GUI till I'm happy with it.

A: 

If you on a linux box, you can try these steps, if on windows, pretty the installer shall do things for you. https://help.ubuntu.com/community/Subversion

Also the subversion book might help http://svnbook.red-bean.com/en/1.5/index.html

Varun Mehta
This in not really helpful. The question is about ignoring files in SVN, and you talk about general setup.
Otherside
+1  A: 

IIRC, Subversion won't stop you from svn adding files that you marked as ignored if you explicitly add them by name (though it may warn you). The svn:ignore property is primarily there to prevent them from showing up in svn status.

Also, AFAIK, the svn:ignore property is not recursive, so it will only work on first-level children of the directory it is set on.

rmeador
+2  A: 

There are basically two ways to instruct subversion to ignore files either by name or by pattern.

The first way is to find the configuration file (location depends on platform) and add the file name or pattern to the global-ignores list. This applies to all svn operations on the machine or for that user.

The second way is to set the svn:ignore property on a versioned directory, for example:

svn propedit svn:ignore myDirectory

This brings up an editor for the svn:ignore property where you can add for example:

bin
obj
*.bak

Note that this property change is also versioned and needs to be committed, after that they apply for everyone working on that directory (after an update of course). This property doesn't apply recursively to subdirectories.

For more info see the svn book.

Carl Serrander
A: 

Could you be a bit more clear about what specifically svn is getting confused about? Remember that the svn:ignore property is a per-directory setting; i.e. if you want to ignore .foo files in ./bar and in ./bar/abc, you need to edit the property for each directory. Yes, it is a pain in the butt.

Devrin
A: 

There are a couple of ways I've added projects to source control. Here's a higher level description:

One way is to import an empty top-level folder, then svn checkout, then copy the project files to that working copy, then svn add all but the files to be ignored (or svn revert specific files/folders) and set ignore properties as desired, then commit.

Another way is to make a copy of the project files, manually delete files and folders to be ignored, then svn import. Then delete those files. Then do an svn checkout, then setup the ignore properties on that working copy and svn commit. Then copy the original ignored files/folders to the working copy.

Of course, the more things that are globally ignored the easier these steps will be.

Mike Henry