Skip to content

Commit

Permalink
updates for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Oct 27, 2009
1 parent 18ec70e commit 1876fc0
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions README.md
Expand Up @@ -9,12 +9,13 @@ reimplementations of core Git functionality. This choice, however, is
transparent to end users, and you need not know which method is being used.

This software was developed to power GitHub, and should be considered
production ready. An extensive test suite is provided to verify its correctness.
production ready. An extensive test suite is provided to verify its
correctness.

Grit is maintained by Tom Preston-Werner, Scott Chacon, Chris Wanstrath, and
PJ Hyett.

This documentation is accurate as of Grit 1.2.
This documentation is accurate as of Grit 2.0.


## Requirements #############################################################
Expand All @@ -26,15 +27,7 @@ This documentation is accurate as of Grit 1.2.

Easiest install is via RubyGems:

$ gem install grit

or

$ gem sources -a http://gems.github.com/ (you only need to do this once)
$ gem install mojombo-grit

The gem from GitHub will generally be available sooner than the gem from
Rubyforge. Both sources will eventually contain the same releases.
$ gem install grit -s http://gemcutter.org


## Source ###################################################################
Expand All @@ -47,26 +40,30 @@ and cloned with:

git clone git://github.com/mojombo/grit.git


### Development

You will need these gems to get tests to pass:

* technicalpickles-jeweler
* jeweler
* mocha


### Contributing

If you'd like to contribute to Grit, we ask that you fork mojombo/grit on
GitHub, and push up a topic branch for each feature you add or bug you fix.
Then create an issue and link to the topic branch and explain what the
code does. This allows us to discuss and merge each change separately.
Then create an issue and link to the topic branch and explain what the code
does. This allows us to discuss and merge each change separately.


## Usage ####################################################################

Grit gives you object model access to your Git repositories. Once you have
created a `Repo` object, you can traverse it to find parent commits,
trees, blobs, etc.


### Initialize a Repo object

The first step is to create a `Grit::Repo` object to represent your repo. In
Expand All @@ -82,6 +79,7 @@ a bare repo.

repo = Repo.new("/var/git/grit.git")


### Getting a list of commits

From the `Repo` object, you can get a list of commits as an array of `Commit`
Expand Down Expand Up @@ -112,6 +110,7 @@ If you need paging, you can specify a number of commits to skip.

The above will return commits 21-30 from the commit list.


### The Commit object

`Commit` objects contain information about that commit.
Expand Down Expand Up @@ -148,6 +147,7 @@ You can traverse a commit's ancestry by chaining calls to `#parents`.

The above corresponds to **master^^^** or **master~3** in Git parlance.


### The Tree object

A tree records pointers to the contents of a directory. Let's say you want
Expand Down Expand Up @@ -191,6 +191,7 @@ You can also get a tree directly from the repo if you know its name.
repo.tree("91169e1f5fa4de2eaea3f176461f5dc784796769")
# => #<Grit::Tree "91169e1f5fa4de2eaea3f176461f5dc784796769">


### The Blob object

A blob represents a file. Trees often contain blobs.
Expand Down Expand Up @@ -221,3 +222,15 @@ You can also get a blob directly from the repo if you know its name.

repo.blob("4ebc8aea50e0a67e000ba29a30809d0a7b9b2666")
# => #<Grit::Blob "4ebc8aea50e0a67e000ba29a30809d0a7b9b2666">


### Other

There are many more API methods available that are not documented here. Please
reference the code for more functionality.


Copyright
---------

Copyright (c) 2008 Tom Preston-Werner. See LICENSE for details.

0 comments on commit 1876fc0

Please sign in to comment.