Xcode duplicates my repository and renames its location to lowercase

时光怂恿深爱的人放手 提交于 2020-01-13 05:26:09

问题


I have a Git repository where my project is linked to. It is located somewhere like /Users/a/Documents/Xcode Projects/MyProject. I use Xcode's UI to commit changes and it worked perfectly for a couple of times. But now, out of a sudden, I get this error when trying to commit new changes:

The working copy myproject could not be reached. Please verify that the working copy is reachable and try again.

As you can see, the message shows my project's name in lowercase and when I check the Repositories in XCode (File - Source Control - Repositories...). I see there are two, apparently identical, repositories (they both link to the same Origin), but one with the name all in lowercase.

The correct one location is /Users/a/Documents/Xcode Projects/MyProject as I told you. But the duplicated one is supposed to be located in /Users/a/Documents/xcode projects/myproject which, of course, does not exist.

Does anybody know why is this happening? Can anybody help me to delete this duplicated repository and make my project link the correct one? So I can keep using the XCode's UI to commit changes in my code.


回答1:


I found that Xcode 4.2 can behave in two different ways depending on what exactly you select in the File->Open dialog, when opening the project from within Xcode:

  1. The .xcodeproj file
  2. The project folder (containing the .xcodeproj file)

Selecting 1 or 2 and pressing enter wil give me two different repositories with different paths in Xcode's Repositories, so sometimes it helps to close the project, delete both repositories and then open the project in "the right way", say 1 or 2.




回答2:


I had the same problem. You probably clicked the recent opened project offered at the beginning of Xcode screen. I chose to open the project/workspace from manual selection in the file system and it solved this duplicated working copy issue. Hope it could be a help.



来源:https://stackoverflow.com/questions/9673366/xcode-duplicates-my-repository-and-renames-its-location-to-lowercase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!