Saturday, March 27, 2010

GitHub Repository as Source Code Repository

toolsWhile I was doing programming with XCode last night, one thing came to my mind: I need a repository to keep track of my source codes. It is not only a good way to save and track my changes, but it also provides a remote repository on Cloud to safely keep my project source codes. So I started to investigate options.

I have done some projects by using Google Code. I use it as a host for my public shared projects. I have not really used it as my source code repository. At work, I also use Subversion(SVN) as a alternative repository. Here is a list of SVN listing. For personal use, I heard many developers recommending GitHub as an alternative. So I gave it a try.

I created an account at GitHub. The basic account is free with .3GB space and no private repository. It provides update to fee-based private repositories. The following is what I have done.

First I need to install git. There is Mac version at Google. The installation is straightforward by running the installation pkg. A reboot is required to access to git in Terminal. I think the installation may add git to the terminal PATH.

The second step is to generate a SSH key. GitHub provides detail step-by-step information about this on Mac. I think this key is used to identify my Mac to a remote SVN repository.

The third step is to add the key to my GitHub account. The key is in my ~/.ssh folder. The generated SSH key is rsa type and the public key is in the file of After adding my public key to my GitHub account, there is one file is created in my ~/.ssh folder as know_hosts.

That's all I have done so far. I have not reached the point to save my source codes in XCode to a repository yet.