Add files to SVN then delete before commit

Eric picture Eric · Aug 5, 2011 · Viewed 23.6k times · Source

I guess I was careless.

I added a bunch of files to svn with svn add, then I saw a few files added that I didn't want so I deleted them with rm.

Now I can't commit anymore because the commit is missing files. I tried svn cleanup but it didn't help.

My working option now is to manually delete every .svn directory but that seems wrong.

Answer

patrickmdnet picture patrickmdnet · Aug 5, 2011

As I understand it you have this situation:

$ touch foo
$ svn add foo
A         foo
$ rm foo
$ svn ci
svn: Commit failed (details follow):
svn: 'foo' is scheduled for addition, but is missing

So to fix it do this: (thanks Linus!)

$ svn revert foo
Reverted 'foo'

or you can do this:

$ touch foo
$ svn delete --force foo

for each file, and you should be able to check in without problems.