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?
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?
I suspect that \Path\To\The\Directory doesn't exist in the branch, but does exist in the trunk. Newly added to the trunk maybe? When you switch, SVN thinks it should be adding it to your local directory, as it's not (supposed to be) in the branch that you're switching from. But it's there anyway. This could be a result of a prior switch without a proper checkout. i.e. you did this switch before, and then when you switched from the trunk back to the branch, you didn't clean up the crud. so now the leftover directory is present, and it doen't expect to see it.
Maybe Path/To/The/Directory
doesn't exist in your current branch, but it does exist in trunk?
Another thing that might be the problem is when the SVN server is running a case-sensitive OS (*nix, for example), and you are using Windows. In that case, the SVN server will consider:
Path/To/The/Directory
Path/To/The/directory
as two different directories. This usually happens when someone does a case change on the directory name.
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.