Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn Error: a versioned directory of the same name already exists

I am trying to switch my local folder from Branch to Trunk. I get the following error.

Failed to add directory 'Drive:\Path\To\The\Directory'
a versioned directory of the same name already exists

What is the resolution for this?

like image 950
Amitabh Avatar asked Jun 21 '10 11:06

Amitabh


1 Answers

You often see this if you have a situation where you've created a directory on the branch (even I think if you haven't checked it in), but meanwhile someone has also created a directory of the same name on the trunk. So when you switch from branch to trunk it's trying to check out trunk's version of the directory, but it can't because it already exists and so it doesn't want to trash your version of it.

EDIT:

The best way to resolve this is to rename this directory in your working copy then update. After the update you can decide whether you need to copy the contents into the newly created directory.

EDIT2:

There isn't a good way of SVN resolving this automatically. It sounds like you have created this folder in your working copy (which is currently checked out on the branch) while someone else has created a folder of this name on the trunk. When you switch it's trying to create the new directory, but it can't because you've already got one. I maintain that the only way of dealing with this is to rename the directory temporarily, then switch and then compare the contents of both directories to see if there are extra files you need to add or merge.

like image 93
the_mandrill Avatar answered Sep 29 '22 12:09

the_mandrill