架构深渊

慢慢走进程序的深渊……关注领域驱动设计、测试驱动开发、设计模式、企业应用架构模式……积累技术细节,以设计架构为宗。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Failed to add 'XXX': object of the same name already already exists

Posted on 2009-02-17 15:46  chen eric  阅读(1685)  评论(0编辑  收藏  举报

This error message typically occurs when you try to update your working copy. It is thrown because Subversion never deletes or overwrites existing local data. There may be three reasons why you get this error:

  1. You have a local unversioned file with the same name as a file which has been added by somebody else recently. In this case the solution is to move your local file somewhere else (or rename it), then update. Afterwards you can decide whether the two files need to be combined in some way, or if the choice of name is purely coincidental you can give your file a different name.
  2. A file has been renamed in the repository, but it differs only in case, like Install.txt to install.txt, and you have local changes. When you update, you end up in a situation (1), where the modified local file appears as unversioned. Move it somewhere else, update, then sort out the mess.
  3. There are actually 2 different files in the repository whose names differ only in case. This cannot work on a Windows checkout, because the Windows file system is not case-sensitive. It is likely that one of the files got added by mistake, so you need to find out which one, make sure there are no changes committed to the wrong file, then delete it.

There are several ways to solve the problem and to prevent it from happening again. Take a look at these instructions