Getting an Xcode project from Git

There are plenty of pages that will help you add an Xcode project to Git, but I couldn’t find anything on connecting Xcode to an existing Git repository. Here’s how you do that.

Here are the steps for Xcode 4.2:

  1. From the main Xcode window, select File / Source Control / Repositories…
  2. Tap the little + button at the bottom of the repository list at the left, and select Checkout or Clone Repository.
  3. Enter the location of the repository (which looks something like git@server.com:path/project.git), and hit Next.
  4. Enter the name for the local project, and click Clone.
  5. Select the location on your local file system for your local repository.

That’s it – you’ll have your project ready to open in Xcode, connected to a local repository, and ready to Push or Pull changes with a remote repository.

Note that for this to work your system needs to be configured with an SSL key that matches the repository. There are plenty of other pages that cover how to do this, so I won’t cover it here. Instead, start with this page.