No Repository Type Git in Xcode 4 Developer Preview? Here is the solution!

29 Jun

Besides all the iOS 4.0 hype and the fantastic new iPhone, what really made my day is the forthcoming new version of Apple’s IDE: Xcode 4.

After all, WWDC is a Developer Conference. Innovating the essentials tools we all work with daily, is as big a part of what we should have come to expect, as new SDKs and updated operating systems. Unfortunately, I cannot post any details about Xcode 4, nor any screenshots, as the current preview is still under NDA.

A key feature, that has been leaked elsewhere, is Git (and GitHub) support. I heavily use Git as a Source Code Management solution, both in my company and for my private projects.

I was literally blown away by the level of support for Git, that Apple demoed during WWDC.

No wonder, that huge disappointment hit me, when I tried to clone my first Git repo with the Xcode 4 Developer Preview and did not find the “Git” repository type in the UI. The only type offered was Subversion.

Turns out, there’s a simple solution: Xcode 4 expects the git command line tool to be available in /usr/bin. A quick which git on my console revealed, that my git binary instead resided in /usr/local/git/bin/git.

After creating a symlink in /usr/bin pointing to /usr/local/git/bin/git and restarting Xcode 4, everythink worked perfect!

The full command: sudo ln -s /usr/local/git/bin/git /usr/bin/git

A couple of observations: Connecting to GitHub did not work via the native git protocol, so I had to paste in the https URI to the repo. Same with ssh key based authentication, which did not work. I had to use my GitHub registered email address (username did not work) and password.

Besides this, working with a GitHub hosted git repository from within Xcode 4 just got really fantastic!

Tags: , ,
2 replies
  1. Ivo Brodien says:

    I just downloaded the XCode 4 preview 2 and tried to clone a repository but it does not work. Does your method still work? I get a “fatal: HTTP request failed”, when I try to clone the repo.

    I tried these URLS:

    and as a login I tried my email and my username.

    Any ideas?


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

© Copyright 2017 by Ralf Rottmann.