Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using svn remove - preserve file on disk instead of having it deleted?

Tags:

svn

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

like image 650
user246114 Avatar asked Apr 30 '10 21:04

user246114


2 Answers

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

svn remove --keep-local bin/horse.class
like image 182
mathmike Avatar answered Oct 06 '22 01:10

mathmike


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
like image 40
Dmitry Yudakov Avatar answered Oct 05 '22 23:10

Dmitry Yudakov