views:

26

answers:

1

How do I get the Root :tree_sha of a GitHub repository via the GitHub API?

The GitHib API help pages don't seem to explain this critical piece of information:

http://develop.github.com/p/object.html

Can get the contents of a tree by tree SHA

tree/show/:user/:repo/:tree_sha

To get a listing of the root tree for the facebox project from our commit listing, we can call this:

$ curl http://github.com/api/v2/yaml/tree/show/defunkt/facebox/a47803c9ba26213ff194f042ab686a7749b17476

A: 

http://develop.github.com/p/commits.html

The commit tells you its tree sha.

Chris Jacob