The Git integration in XCode 4 is very welcome however it seems to be a bit flaky when it comes to dealing with remote repositories. For clarity I’m using Mac OS X version 10.6.7 and XCode 4.0.2 (4A2002a).
If I create a new XCode 4 Project and accept the option to create a local Git repository, all is well. I can commit locally and that’s great.
When I want to push the new project to GitHub I want to add a remote repository and push my local changes up to GitHub. I can add a GitHub repository to XCode 4 as a new Repository in the Organizer window but there’s no method of setting it as a remote repository for my existing project.
So instead here’s the 12 steps that I followed to get GitHub to work with a new XCode 4 project