svn: file is scheduled for addition, but is missing

If you add a file in subversion and then delete it before commiting e.g.:

$ touch myfile
$ svn add myfile
A         myfile
$ rm myfile

And then commit, you will get the following error message:

$ svn ci
svn: Commit failed (details follow):
svn: 'myfile' is scheduled for addition, but is missing

There are two possibilities to fix it.

Either you have to revert it:

$ svn revert myfile
Reverted 'myfile'

Or you have to forcefully delete it:

$ touch myfile
$ svn delete --force myfile

After that you can commit without errors. Of course, if you have multiple such files, you’ll have to take care of each one of them before commiting.

To find such files, you can use the svn command status:

$ svn status
!       myfile

If the deleted file was a folder, you’ll have to revert not only this one folder but all children files and folders:

$ svn revert myfolder --depth infinity

In order to prevent this problem, you should rather use the svn command rm instead of removing the file using the operating system command e.g.:

$ svn rm --force myfile

Leave a Reply

Your email address will not be published.