tags:

views:

62

answers:

5

Hi,

I am creating an eclipse project, which generates a lot of files I don't want to keep under version control. For example, it creates a project folder like:

project/
    bin/
      horse.class
      cow.class
    src/
      horse.java
      cow.java

so what I do is add the project folder to svn, like:

svn add project

this puts everything under control, even the bin and .class files. All of those files will have the little 'a' next to them.

How can I simply remove the 'add' status from those files? If I try:

svn remove bin/horse.class 

I have to use the --force option and it deletes the file from disk. Is there a way to simply remove it from source but not delete the file from disk?

Thanks

A: 

svn rm --keep-local bin/horse.class should do the trick, although I would recommend the use of subclipse. Installation is very simple, and it is much more integrated than the commandline tools (as I'm sure you can imagine).

welp
hmm I don't think --keep-local is supported by 'standard' svn?: http://svnbook.red-bean.com/en/1.0/re08.html It is not mentioned in the docs?
A: 

Not a direct answer to your question, but I would suggest you try out an svn plugin for eclipse, for example: subclipse.

It will automatically only add the correct files for you.

Blorgbeard
A: 

Before adding set up the ignore property of svn to ignore the files you don't want to get added. Look out for the global-ignores in the [miscellany] section in the subversion configuration file. On Linux this is ~/.subversion/config, on Windows it's %USERDIR%\Application Data\Subversion\config. This however only works for files that you can match with global patterns (like all files ending in .class etc).

In the layout shown below I wouldn't simply add project but only the files that should get under version control -- assuming that project/bin/horse.class is the only file to get omitted you can simply do the add as svn add --parents project/src; svn add --parents project/bin/cow.class.

bluebrother
A: 

If you have a recent version of SVN (at least 1.5), you can use

svn remove --keep-local bin/horse.class
mathmike
+1  A: 

You can use svn revert command.

revert: Restore pristine working copy file (undo most local edits).

usage: revert PATH...

Since your file's pristine state is not-added it should work for you.

svn revert bin/horse.class
Dmitry Yudakov