Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories.
Currently it is a wrapper around the git binary, but I'm hoping the git libification project will come far enough that I can write some C bindings instead.
gem install git
Simple ExampleThis is taken straight from one of the first examples on the Everyday Git tutorial from the Git website. It initializes a repository in an existing directory, adds all the code into the index and commits it with a message |
|
Index WorkIn this example, we clone a public repository, then chdir into the working directory, do some work and then print out the contents of the index versions of all of the changed files. |
|
Branching, Merging and RemotesHere is a more complex example where we:
|
|
If you would like to help out with the project, you can download the source code by cloning my git tree, which is publicly hosted at GitHub.
git clone git://github.com/schacon/rubygit.git
If you would like to send me a patch, please do so at schacon@gmail.com, or ask me to pull your git repo.
Ruby/Git was developed by Scott Chacon, a fan of both Ruby and Git.