Friday, June 08, 2012

How to set up an SVN Repository on Skydrive, Dropbox, Etc.

I was in a bit of a pickle the other day.  My home server was out of commission and I use it for my Subversion server.  I was about to start a new project, but being paranoid, I didn’t want to do it without source control of some sort.  I began looking into git, and free online SVN solutions, but I wasn’t really impressed with any of them.  Some require that your software be open source or they will charge you for it.  Most of the free ones limit your space to somewhere around 500mb.  I wasn’t a fan of this.  Plus, if I used an online SVN, I wasn’t sure if I could download the entire repository to my server later.  So I got an idea.  Being a fan of online folder syncing, I decided to use Dropbox as a place to store my repository. I chose to do this for the following reasons:

  1. It was free.
  2. I have complete control over the repository.
  3. Dropbox will give me 2gb of free space vs the 500mb or less I found with most free SVN hosts.
  4. It was really simple.

Here’s how I did it.

Step 1

Sign up for and install on your machine an online folder syncing service like Dropbox.  If you don’t like Dropbox, here are the links to a few different ones you can try.  They all have their pros and cons, so pick the one you like best.

There are quite a few more out there.  I’m currently a SkyDrive user ‘cause I like their T&C’s the best and they gave me 25gb for free, but for this tutorial I’ll be using Dropbox.

After Dropbox is installed, you will have a folder called Dropbox. Everything you place in here will be backed up and synced with their online servers. This is where we’ll create our repository. For that we’ll need Tortoise or something similar.

Step 2

Download and install Tortoise SVN from here.  You may have to reboot your computer after the install.

Step 3

Open up your Dropbox folder and create a folder to store your repository.  I’m calling mine Local SVN.

folder

Step 4

Open the folder you created to store your repository, and right click. From the menu select TortoiseSVN->Create Repository Here. 

SvnMenu

Your repository will be created and you will get a dialogue asking if you’d like to create the default folder structure.  You can if you like.  It makes no difference to this tutorial.  Then click the Start Repobrowser button.

dialogue

Copy the URL from the repobrowser as you will need it in just a second.

Step 5

Create a folder somewhere on your machine to store your local version of your code. I created mine here C:\Dropbox Repos\Local SVN

Step 6

Rightclick on your new folder and select SVN Checkout… from the menu.

MenuCheckout

Paste the URL of the repository that you copied from the repobrowser into the box labeled URL of repository: (duh), and click OK.

Checkout

Step 7

You’re done! If all went well, you should now have your default folder structure (if you created it, if not, the folder will be empty) in your folder and you can use it as your new repository.  Any updates you make will be committed to your repository in your Dropbox folder and synced with their servers, making fear of code loss a thing of the past.  And you can check out and use the repository on any machine that you’ve installed Dropbox on.

 

I know that this is not an ideal solution, but for me it was great because as soon as I got my server back online, I was able to just copy the repository to it’s rightful home.  So, it may not be the best solution ever, but if you ever find yourself in a serverless jam, I found it to be most helpful, and I thought someone else out there might be able to use it as well.

3 comments:

  1. What happens if you delete "Local SVN" on one of your dropbox-tied computers?

    ReplyDelete
  2. As long as you're not deleting the repository folder in your dropbox folder, there shouldn't be any issues. ex:

    Delete C:/Dropbox Repos/Local SVN = OK

    Delete D:/Dropbox/Local SVN = Problem

    ReplyDelete
  3. I've just discovered, that SVN versions 1.7 and 1.8 are not compatible. When you create repository using SVN 1.8, you cannot checkout it with SVN 1.7

    ReplyDelete