简体   繁体   中英

How to create an Xcode project for an existing GitHub repository

I am working with an existing GitHub repository and I want to create a new Xcode project from it. How can this be done?

I have previously used Xcode just as a python script editor and never created a project, but I would like to do so in this case so that I can have a special indentation style just for the files in this project (this is Python, so no interest in build targets etc, just want to edit and use git).

I am using Xcode 6.0.1 on Mavericks.

IanAuld's answer sent me in the right direction and I figured out what I was doing wrong. I had been assuming that the Xcode project should be inside the directory with the git project, but that was causing problems because then git tries to track the Xcode project.

Here's what I am now doing, which seems to work:

  • Create a new Xcode project somewhere that is not managed by git. Make sure that " Create Git repository on ... " is not checked.
  • Clone the github project to a directory that does not include the Xcode project.
  • In Xcode, File | Add Files to "ProjectName"... , and select the folder with the git project.

Now, if I edit any of those files in the context of the project, it uses the indentation style I set for the project (though if I edit the file on its own it uses my global indentation style), and I can control git through the Source Control menu.

Problem solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM