Resolving “local delete, incoming delete upon update” Subversion Tree Conflicts
NOTE 1: Before doing this, try using the svn resolve command.
NOTE 2: I’ve noticed a lot of traffic to this page for “local edit incoming delete on update” errors, which are not what this article is about (the solution below may or may not work for that — I have no idea). This article is about “local delete, incoming delete on update” errors. Always back up your work before you muck around with something like this, but that goes doubly if you’re going to try to use these instructions for the “local edit” error.
For reason I’m still trying to untangle, I encountered some really terrible conflicts this afternoon with an SVN checkin that didn’t complete properly, leaving me with a few locked directories that wouldn’t respond to “svn cleanup”.
Using these instructions, I was able to get the directories sorted out:
- Move offending directories out of working copy and to a safe place (e.g. desktop)
- Run
svn cleanup
- Run
svn up
This actually restored the messed-up directories. Some files were reverted and some deleted files restored; once the entire working copy is cleaned up, you can use the backup copies of the directories to copy back in your changes.
But before I could do that, I was left with a half-dozen individual file conflicts with the following messages:
$ svn st
? C some_file.php
> local delete, incoming delete upon update
? C some_other_file.php
> local delete, incoming delete upon update
... etc.
Thankfully, these were files that I did want to delete, so even without instructions I wasn’t afraid to trial-and-error my way to the following fix:
$ touch some_file.php some_other_file.php
$ svn revert some_file.php some_other_file.php
Once you’ve created the files, SVN can revert them, which leaves them in unversioned status:
$ svn st
? some_file.php
? some_other_file.php
And then you can just delete them from the command line or whatever file manager you use.
*Phew*
Once that was done I redid some deletions that had been overwritten by the update that cleaned up the directories, and all was right in the world.
Usual disclaimers, YMMV, etc.
COMMENT: by Jeff Z., March 12th, 2010
Thanks for posting this. You saved me a bunch of time today!
COMMENT: by Mike Stoddart, April 12th, 2010
Thanks! This helped me too!
COMMENT: by Jo, April 14th, 2010
Thanks mate
COMMENT: by gjigandi, May 30th, 2010
Thanks a lot!!!
COMMENT: by Sri, June 30th, 2010
Thanks so much for your post!! I was having problems merging my branch + trunk after 2 months of code changes. Works great now.
COMMENT: by Chris, July 8th, 2010
Thanks, this was helpful.
COMMENT: by Dieter_be, August 13th, 2010
Thanks!
I had a “local edit, incoming delete upon update” which I could not resolve, and your instructions worked fine.
Note that you don’t need to touch + revert + rm
I just did an svn revert, which ironically, did not put the files back in place, but at least svn stopped complaining. (and still svn revert + rm would work as well, touching doesn’t seem to be needed)
COMMENT: by Noemi Millman, August 13th, 2010
Thanks, Dieter — that will be very helpful for some of the people who land here.
I assume that a touch was not needed in your case because the files already existed in the local tree; whereas with the local delete / incoming delete version the files aren’t present locally, and for some reason SVN refuses to revert the missing files.
COMMENT: by Ananth, February 16th, 2011
Thanks mate. You saved my time.
COMMENT: by Bruno, February 24th, 2011
Thanks from Brazil. Saved my time (and my head).
COMMENT: by Matthew, February 26th, 2011
Thanks, so simple!
COMMENT: by Renaud, March 22nd, 2011
thanks a lot!
COMMENT: by Tim, March 23rd, 2011
Thanks
worked for me on this error:
“local delete, incoming delete upon merge”
COMMENT: by Brian, March 30th, 2011
Thanks! This works for directories as well as files. mkdir, revert, then rmdir. Yay!
COMMENT: by Gustavo Bellino, May 11th, 2011
Hello, thank you! I had the same problem but instead of being a file it was a folder, I did almost the same, I put
svn revert name_of_the_folder (even if the folder does not exists)
then
svn cleanup
and then wola! problem solved. Thank you.
COMMENT: by Sylvain Bolay, May 17th, 2011
Thanks a lot Noemi for this great help!
COMMENT: by fatINbraIN, July 15th, 2011
thx for solution.
COMMENT: by Roy, August 24th, 2011
Life saver. Thank you so much!
COMMENT: by Henry, January 13th, 2012
easy and smart way, thanks!
COMMENT: by Christopher, April 13th, 2012
THANKS!! This worked nicely.
COMMENT: by olga, July 10th, 2012
No need to ‘touch’ the files you meant to delete. svn revert will work on them right away and save you the extra steps.
COMMENT: by Noemi Millman, July 11th, 2012
olga, that may be the case for the “local edit” variant, but for the “local delete” problem, SVN won’t revert because it can’t find the files in the working copy. (Unless that’s changed in newer versions of SVN.)
“touch” creates dummy files that SVN can work with.
COMMENT: by shreyas kulkarni, July 19th, 2012
hey thanks! that was spot on. man, svn is obtuse sometimes!
COMMENT: by Rakesh, December 25th, 2012
You are a life saver.. Thanks!
COMMENT: by Eduardo, April 25th, 2013
Thanks for that, helped me!
COMMENT: by Barney, March 26th, 2014
I’ve come from the future to say thanks. Thanks a million. J’ai bien tripoté avec SVN, mais c’était question de *comment* tripoter