Putting Git in the cloud with Amazon S3

written by tobinharris on July 22nd, 2008 @ 01:00 AM

I've been playing with the Git this week.

Trying it locally is all very well, but I now want to try it from various locations and computers. I guess I need a central repository...

Before signing up to GitHub or Unfuddle, I thought it might be fun to see if I could use it with Amazon's S3 cloud storage.

I only just got this set up, but it appears to be working!

In fact, I cheated, and used JungleDisk which gives me a file system wrapper on to S3.

Basic steps as follows:

  • Sign up for Jungle Disk
  • Download client software and install
  • JungleDisk gives you drive that links to S3 (my disk in the cloud!)
  • Now we just use standard git commands to set up the remote repository (thanks to Toolman Tim for nice instructions)
  • Use git --bear init ... to set up a blank repository on the cloud disk
  • Use git remote add ... then gid push ... to move local repos to cloud disk.
  • On some other machine, also install JungleDisk. Then do a git clone ... to get a working copy of the code.

I like this idea because

  • Amazon S3 is cheap
  • Amazon is low maintenance and has fail-over (unlike my Linux server)
  • JungleDisk works on Mac, Linux and Windows
  • I own the S3 account (no JungleDisk)
  • I can still access the S3 using other tools and APIs (such as AWS::S3)

Disclaimer!

I don't know enough about Git or S3 to know if this is a good idea! Anyone got any thoughts?



kick it on DotNetKicks.com



Comments

  • Justin on 01 Aug 13:18

    Wow I was just searching through and thinking about making the move from svn to git when I found your post. I already have jungledisk and an S3 account so this would be perfect for me. Thanks for the idea. Also nice theme, I use the same one on my personal site :).

  • Tzillz on 01 Sep 03:18

    Are you still doing this?

    I’ve been doing SVN on JungleDisk/S3 for a little while now but have had huge problems with the SVN revisions being corrupted every few days. I’m not experienced with git but considering making the switch because of this – is it going well?

  • Tobin Harris on 01 Sep 16:19

    @Tzillz

    Yup, I’m still doing this, it works pretty well.

    On 4 occassions GIT pull or push failed. But there was no corruption. I just had to repeat the command a few times before it reported success. I think this was due to the local cache of JungleDisk catching up with the data on the cloud.

    In all honesty, I think this approach is certainly workable, and very cheap! If I could get SSH access directly to S3 that would be better, as I could use GIT over SSH to push and pull directly without needing JungleDisk as a mediator.

    Eventually I may chose to spend more money on private GIT hosting, which would probably make for a smoother experience and give me extra features (at a cost, of course).

  • Loren Norman on 14 Sep 13:13

    This is interesting, how would it work with multiple collaborators? I would like to remove the JungleDisk requirement, too. Seems like a lot could be achieved with a handful of rake tasks.

Post a comment

Options:

Size

Colors