Xcode , git , and Bitbucket


Xcode , git , and Bitbucket

Bitbucket (https://bitbucket.org/)is a great free source code hosting website. This tutorial will show you how to use bitbucket with Xcode 4.3 on Mac OS Lion. First create a new Xcode project, and ensure that you check the 'Create local git repository for this project' option.

Now register with bitbucket and create a repository. When you register, in addition to making a new repository, you will need to add your public key to your account in order to push your files remotely to your remote repository on bitbucket. A quick google of 'generate ssh public key on Mac' will show multiple examples of creating this key. Once generated, use the command

pbcopy < ~/.ssh/id_rsa.pub

to copy the key to your clipboard. Now you can easily paste the key into your bitbucket account.

Now, we need to fill-in our remote repository information in Xcode. We will need the remote repository information from bitbucket. Click on the repository link in bitbucket and copy the path to the repo as shown below in the red outline.

Paste the path into the Xcode Organizer ( Window >> Organizer ) 'remote' repository information for your new project.

Now we're almost done! To commit and push your changes, choose File >> Source Control >> ( Commit | Push ). Choose Push to send your changes to the remote repository hosted on bitbucket.

I hope this helps someone out - Happy Coding!


APClassy 2013