Thursday, January 19, 2012

Setup Xcode 4 with a new Github repository



With the release of Xcode 4, it has become fairly easy to integrate Xcode 4 with Github's repositories. It requires a few basic steps that need to be followed if your a first time user.
  1. You need to install git and setup a new Github repository as described here.
  2. Open Xcode.
  3. Create a new project under Xcode and try to keep it of the same name as the Github repository. It saves you from hassle
  4. Select "Create local git repository for this project". (It is usually selected by default)
  5. Go back to the newly created git repository and follow directions to setup an existing repo. It should resemble the image below:
  6. Keep in mind, the "existing_git_repo" directory is your current project directory created by Xcode.
  7. Now your all set and you can commit your changes to Github through Xcode either by right-clicking on the project and selecting commit or by going to File->Source Control -> Commit (alt+command+c).
  8. Once your ready to push changes, goto File->Source Control -> Push and you should be able to see your commit on Github.