SVN:ignore how-to and on what?
Asked Answered
T

2

8

It seems to me that adding the property svn:ignore on files like .classpath would be a good idea. I use both Windows (work, ugh) and Linux development environments and every time I sync with the repository it overwrites my .classpath from whichever machine I'm working on.

I tried right-clicking the .classpath file in the Team Sync perspective, but the svn:ignore option is greyed out.

Any ideas how I might: 1. get this item out of source control, 2. add it to an ignore list?

Any other files a smart addition to this list?

Topazolite answered 17/3, 2011 at 19:34 Comment(0)
V
8

At the command line:

svn rm --keep-local .classpath
svn pe svn:ignore .

The first command removes .classpath from SVN while keeping the file locally. The second command lets you edit svn:ignore. Add ".classpath" to the property.

The general rule is that any build output, machine-specific, or user-specific files should not be versioned and then be added to svn:ignore. I'm not familiar with Java or Eclipse specifically so I couldn't mention any files by name.

Venerate answered 17/3, 2011 at 19:45 Comment(3)
Note that --keep-local keeps the files for you, but removes them for anyone else that runs svn update afterwardsShrum
I intend on getting this worked out over the weekend. Thank you for the reply!Topazolite
@SanderRijken I use something like ' find -iname "*" -type d -execdir svn rm --keep-local .settings .classpath .project target \; ' to remove-but-keep-local all the files that I ignore. (This uses the linux find command.)Ofay
M
3

To get svn:ignore, remember that svn:ignore is a property of a file system entry. That means you need to use svn propedit svn:ignore (to edit the property).

What should you ignore? Anything that's built from something else. All "lock files" that editors might put in place. All temporary files. Some configuration files that require differences between developer (however, you should check in a template with a slightly modified name, like config.template). Basically, anything that you don't want checked in.

It sounds like you are using a non-command line client. Maybe the client is configured to not allow you to modify this file (or it's properties). Maybe it's a different issue. I would recommend installing a command line client, as the errors will be more verbose (and not subject to interpretation like your "grey" color is).

Odds are good you will have to svn:delete the file first (make a copy of it or you'll lose your only copy), and commit the "deletion" back to the repository. Then propedit the directory where the .classpath file was to add ".classpath" to the svn:ignore list.

Mercer answered 17/3, 2011 at 19:41 Comment(3)
subclipse is indeed a client for eclipseShrum
I intend on getting this worked out over the weekend. Thank you for the reply!Topazolite
Good luck with your effort, it's not nearly as hard as it seems!Mercer

© 2022 - 2024 — McMap. All rights reserved.