
GitStore - Git as versioned data store in Perl

use GitStore;
my $gs = GitStore->new('/path/to/repo');
$gs->set( 'users/obj.txt', $obj );
$gs->set( ['config', 'wiki.txt'], { hash_ref => 1 } );
$gs->commit();
$gs->set( 'yyy/xxx.log', 'Log me' );
$gs->discard();
# later or in another pl
my $val = $gs->get( 'user/obj.txt' ); # $val is the same as $obj
my $val = $gs->get( 'config/wiki.txt' ); # $val is { hashref => 1 } );
my $val = $gs->get( ['yyy', 'xxx.log' ] ); # $val is undef since discard

It is inspired by the Python and Ruby binding. check SEE ALSO

GitStore->new('/path/to/repo');
GitStore->new( repo => '/path/to/repo', branch => 'mybranch' );
GitStore->new( repo => '/path/to/repo', author => 'Someone Unknown <unknown\@what.com>' );
your git dir (without .git)
your branch name, default is 'master'
It is used in the commit info
$gs->set( 'yyy/xxx.log', 'Log me' );
$gs->set( ['config', 'wiki.txt'], { hash_ref => 1 } );
$gs->set( 'users/obj.txt', $obj );
Store $val as a $path file in Git
$path can be String or ArrayRef
$val can be String or Ref[HashRef|ArrayRef|Ref[Ref]] or blessed Object
$gs->get( 'user/obj.txt' );
$gs->get( ['yyy', 'xxx.log' ] );
Get $val from the $path file
$path can be String or ArrayRef
remove $path from Git store
$gs->commit();
$gs->commit('Your Comments Here');
commit the set changes into Git
$gs->discard();
discard the set changes

run
git checkout
# if you just need a local repo, that's all you need.
mkdir sandbox
cd sandbox
git init
# use GitStore->new('/path/to/this/sandbox')
# set something
git checkout
# follows are for remote git url
git remote add origin git@github.com:fayland/sandbox2.git
git push origin master
# do more GitStore->new('/path/to/this/sandbox') later
git checkout
git pull origin master
git push

http://www.newartisans.com/2008/05/using-git-as-a-versioned-data-store-in-python.html

http://github.com/fayland/perl-git-store/tree/master

Fayland Lam, <fayland at gmail.com>
Itsy bitsy contribution by Yanick Champoux, <yanick@cpan.org>

Copyright 2009, 2010 Fayland Lam, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.