summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.(none)>2007-11-16 11:33:36 -0800
committerscott Chacon <schacon@agadorsparticus.(none)>2007-11-16 11:33:36 -0800
commit8846587d4f3d1ddbc97dda081f052e6515368324 (patch)
tree55e66fb6f77dacd97b0b09d818f6942e1aadf7fa
parent3c1b3f01465a74f7e0617c1d6f06a1f0bf684c90 (diff)
downloadthird_party-ruby-git-8846587d4f3d1ddbc97dda081f052e6515368324.tar.gz
third_party-ruby-git-8846587d4f3d1ddbc97dda081f052e6515368324.tar.xz
third_party-ruby-git-8846587d4f3d1ddbc97dda081f052e6515368324.zip
added some examples to the README
-rw-r--r--README25
1 files changed, 25 insertions, 0 deletions
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