By: Abdelhalim Ragab /abdelhalim (at) gmail.com/

Description:

gits3 is an implementation for git push to use Amazon Simple Storage Services S3 as a remote repository storage

License

gits is licensed under GNU General Public License GPL

News

08/12/2009 demo gits3 at PSU. presentation link
08/10/2009 gits3 finally worked. Push some changes to S3 repo then cloning the repo over HTTP
07/26/2009 Using dulwich git object model as it's already implemented in Python
07/26/2009 Generate the pack name from the list of objects to be pushed
07/26/2009 Traversed the commit graph, and get list of objects to be pushed
06/28/2009 Started gits3 project

Project Plan

plan

Source code

git repository:
http://github.com/abdelhalim/gits3

Quick Howto

Dependencies

  • boto
  • web page
  • gits3 has been tested with boto 1.8d
  • dulwich
  • web page
  • gits3 has been tested with dulwich 0.3.3
  • Amazon S3
  • Setup Amazon S3 account
  • Read S3 documentation to understand S3 concepts

Amazon S3

Amazon S3 URLs

  • git push URL
    amazon-s3://$config@$bucket/$prefix
  • git fetch/pull URL
    http://$bucket.s3.amazonaws.com/$prefix

Amazon S3 JGIT config file

  • create properties file with the Amazon S3 AWSAccessKeyid, and AWSSecretAccessKey, similar to the one used by jgit
    $ touch ~/.jgit_s3_public
    $ chmod 600 ~/.jgit_s3_public
    $ cat >>~/.jgit_s3_public
    accesskey: AWSAccessKeyId
    secretkey: AWSSecretAccessKey
    acl: public
    EOF

Amazon S3 bucket

You have to create the bucket using any S3 tool like S3 Firefox Organizer S3Fox

gits3

  • get the sources
    $ git clone git://github.com/abdelhalim/gits3.git
  • set PYTHONPATH environment variable to point to <gits3>/src/gits3
    $ export GITS3=pwd/gits3
    $ export PYTHONPATH=$GITS3/src/gits3
  • Add Amazon S3 URL to your repo configuration, the example uses a bucket called test_bucket. The bucket must be created before the push command using any S3 tool
    $ cd <local_repo>
    $ git remote add s3 amazon-s3://.jgit_s3_public@test_bucket/projects/scratch.git/
  • push the repo to Amazon S3
    $ python $GITS3/src/gits3/gits3.py push s3 refs/heads/master
  • Further pushes uses the last command only

  • git cloning
    git clone http://test_bucket.s3.amazonaws.com/projects/scratch.git

Reporting Bugs

use git hub tracker issue

Resources and Links

  • jgit: Pure java git implementation that supports S3
  • Amazon S3
  • libgit2: git library take 2
  • dulwich: Pure Python git implementation.
  • boto Python library for Amazon Web Services including S3

Copyright (C) 2009 Abdelhalim Ragab