19

I have a project under source control with at remote repository where I commit and push to.

Now I need to have another programmer work on the same project and therefore same Git repo.

I cannot figure out how one imports a project from an existing Git repo.

I have worked with Eclipse and Git where I have no problem doing this.

Any help is appreciated.

4 Answers 4

32

For xCode 6 and lower

In xCode go to Window >> Organiser

Then select repositories

Click the + button and select Checkout or Clone repository

Then enter the details for your GIT

For xCode7 and above

Go to Window >> Welcome to xCode

Click on the Check out an existing project button on the left hand side.

Then enter the details for the repository you want to access.

Sign up to request clarification or add additional context in comments.

2 Comments

That simple! Thank you!
As of Xcode 7 repositories does not appear under Organiser. You can use Window>>Welcome to Xcode instead.
6

For Xcode 9.4 and Git repository without *.xproj file simple Source Control -> Clone... method doesn't work. Xcode just clones remote repository and opens it in Finder - no project is created nor opened.


Here is what worked for my remote C++ repository:

  1. $ git clone [your_repo.git]
  2. Create new project Shift + CMD + N
  3. Enable version control

    version control

  4. Now you should have cloned repo and new Xcode repo:

    new repo

  5. In your new Xcode repo remove all except *.xcodeproj

  6. In Xcode remove default Groups and Files (except Products):

    remove default groups and files

  7. Copy cloned repo content into new Xcode project directory:

    $ ditto [cloned_repo/] [new_repo/].

    Check that .git directory was copied successfully.

  8. Add dirs and files into the project. Drag'n'drop them from Finder to your new Xcode project. Don't drag .git and *.xcodeproj.

    drag'n'drop

    references

  9. Check branches and commit history:

    check version control history

Comments

3

Since the answers are old, now there's an easier way to directly import/clone project into Xcode from Github and Bitbucket.

Bitbucket: Press Clone in Xcode button enter image description here

Github: Press Open in Xcode button enter image description here

1 Comment

Note that this only works if it's already an Xcode project. github.blog/2017-06-05-clone-in-xcode
0

It seems that now (Version 12.0.1) there is no "officially supported" way to work with source control at Xcode with repository without *.xcodeproj file

1 Comment

Yes you can. See the top voted answer, the section titled "For xCode 7 and above." What I'm seeing is that it'll clone the repo but xCode's Project Navigator isn't populating with the folders since there isn't a project. At this point, you can navigate into that repo and do what you need to do (scripts perhaps) to generate your project. After that, open the project and you should be good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.