Subversion repository on shared hosting and connect to it from Xcode

June 23rd, 2010
Setup SSH access
  1. Go to the cPanel “Manage SSH Keys”, click the “Generate Key” button to generate a pair of keys.
  2. Go back in the “Manage SSH Keys”, Authorization the public key you just generated and download the private key to your local machine.
  3. Let’s say, we want to name the private key file “.id_rsa”. So, copy the download file to “~/.ssh/.id_rsa” and set correct permission on it.
    chmod 400 ~/.ssh/.id_rsa
  4. Connect from the Terminal to verify it works.
    ssh -i .ssh/.id_rsa

Install subversion on the server

I’m using InMotionHosting. Their business hosting plan on edge server has subversion installed. Another so called “developer friendly” hosting company that I know is A2 hosting. BlueHost, MonsterHost and GoDaddy are few that I know people have success installed subversion on them.

Create subversion repositories

Suppose I want to layout my repositories like this:¬†~/svn/repo1/project1, ~/svn/repo1/project2, ~/svn/repo2/project3, …, This is what I do after ssh logon to my server in Terminal:

mkdir svn
svnadmin create svn/repo1

Setup Xcode

  1. Select SCM->Configure SCM Repositories…, go to the SSH tab. You should see the private key file is listed there. If it’s not authorized, type the passphase (the one you typed when generate the key pair) to authorize it.
  2. In the Repositories tab, you should configure it similar to this:
  3. If you’re not sure about the path, type pwd in the Terminal which should print out your path.
  4. Select SCM->Repositories, and select the repository you just configured, the ‘project1’ directory should be listed there. Now you can import your source files into the repository.
  5. To obtain a working copy, select Checkout in the above Repositories dialog.
  6. Now open the Xcode project file you’ve checked out. If it’s SCM not configured, select menu Project->Edit Project Settings…, in the General tab, click “Configure Roots & SCM…”.

Leave a Reply