From 8846587d4f3d1ddbc97dda081f052e6515368324 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Fri, 16 Nov 2007 11:33:36 -0800 Subject: added some examples to the README --- README | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README b/README index 908b8cf..e2d3169 100644 --- a/README +++ b/README @@ -204,3 +204,28 @@ And here are the operations that will need to write to your git repository. g.push g.push(g.remote('name')) + + +Some examples of more low-level index and tree operations + + g.with_temp_index do + + g.read_tree(tree3) # calls self.index.read_tree + g.read_tree(tree1, :prefix => 'hi/') + + c = g.commit_tree('message') + # or # + t = g.write_tree + c = g.commit_tree(t, :message => 'message', :parents => [sha1, sha2]) + + g.branch('branch_name').update_ref(c) + g.update_ref(branch, c) + + g.with_temp_working do # new blank working directory + g.checkout + g.checkout(another_index) + g.commit # commits to temp_index + end + end + + g.set_index('/path/to/index') \ No newline at end of file -- cgit