Thursday, December 11, 2008

Using GIT with Amazon S3 on Windows

As I mentioned in my last blog, I was having some problems pushing changes to GITHUB, which have been resolved (I guess was due to my slow internet connection).
So I thought, we will give a shot to Amazon S3 and to my suprise we got it working in 30mins. OfCourse, it may be as powerful as GitHub in terms of features, but can be the cheapest way to maintain repositories

I did search for some these blogs which guided me,
http://www.tobinharris.com/2008/7/22/putting-git-in-the-cloud-with-amazon-s3
Also, tobharris has a excellent reference to Toolman Tim


Following are the steps are in detail on how to setup

  1. Signup for a Amazon S3 account , click here
  2. Install Jungle Disk, which will map your s3 storage to local drive say y:
  3. Install CYGWIN git and open it
  4. Go to y: from your MSysgit or Cygwin of your GIT, and perform following commands
  5. mkdir var/git/sample.git
  6. git --bare init
  7. go to your project directory, which needs to be pushed on sample.git
  8. git remote add s3origin /cygdrive/y/var/git/sampleajax.git
  9. git push s3origin master //This will push your project to master branch of s3origin
Testing if it on Windows
  1. Open Cygwin
  2. Go to say c:\temp
  3. mkdir sample
  4. cd sample
  5. git config --global user.email youremail
  6. git clone /cygdrive/y/var/git/sampleajax.git
Voila!! You are all setup with GIT on Amazon S3.

GIT and Amazon S3 combination can be used to make cheap backups as well as for maintaining projects.

No comments:

Post a Comment