Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add an existing project as a working copy in XCode 4?

Tags:

svn

xcode4

iphone

Today I switched from XCode 3 to XCode 4 and now I have a lot of problems with my projects, which were under version control in XCode 3. If you install XCode 4, it will remember all your repositories. The problem is, that the projects don't know, that they belong to a specific repository. The instructions of Apple are easy, but do not work:

If you have a working copy of a project that was checked out of Subversion or cloned from Git using the command line or another tool, you can add it to your Xcode SCM repository support. To do so, click the Add button (+) at the bottom of the navigation pane in the repository organizer and choose Add Working Copy.

If I choose the project directory, I get this:

The working copy could not be added because its repository could not be located.

Does anybody know what the problem is?

To avoid confusion, I want to make a few things clear: my projects were under version control in XCode 3 and it worked. I am also aware of the fact, that I could delete all my projects and check them out (I don't want to do that). I already tried to checkout a project, and then this project is automatically added as a working copy. However if I remove the reference and try to add the same (!!) project as a working copy again, it does not work either.

like image 903
mowidev Avatar asked Mar 14 '11 16:03

mowidev


2 Answers

The key for me was quitting Xcode then following Apple's instructions exactly. In Terminal:

  1. $ cd project_folder # project containing the .xcodeproj file
  2. $ git init
  3. $ git add . # note the dot after "add"
  4. $ git commit -m 'Initial version text'

Then get back into Xcode, open the Organizer, et voilà — instant repository.

like image 124
Glenn Avatar answered Sep 28 '22 07:09

Glenn


I was able to resolve this by quitting Xcode and then opening the repository organizer before opening my workspace. Then it worked and I could open my workspace with SVN integration.

like image 31
Udi Avatar answered Sep 28 '22 08:09

Udi