summaryrefslogtreecommitdiffstats
path: root/lib/git.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.(none)>2007-11-13 07:36:50 -0800
committerscott Chacon <schacon@agadorsparticus.(none)>2007-11-13 07:36:50 -0800
commit38f009d6d0aa35b13d19575611db1c724a9d1a5b (patch)
tree207d2ab90604cdd70870ea361aee635cc7ac4654 /lib/git.rb
parentb045fa6be8a299b114c89e25242118748ed3e6c6 (diff)
downloadthird_party-ruby-git-38f009d6d0aa35b13d19575611db1c724a9d1a5b.tar.gz
third_party-ruby-git-38f009d6d0aa35b13d19575611db1c724a9d1a5b.tar.xz
third_party-ruby-git-38f009d6d0aa35b13d19575611db1c724a9d1a5b.zip
updated a bunch of the documentation
Diffstat (limited to 'lib/git.rb')
-rw-r--r--lib/git.rb46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/git.rb b/lib/git.rb
index 7dfbd40..b1d55af 100644
--- a/lib/git.rb
+++ b/lib/git.rb
@@ -23,22 +23,68 @@ require 'git/diff'
require 'git/status'
require 'git/author'
+# Git/Ruby Library
+#
+# This provides bindings for working with git in complex
+# interactions, including branching and merging, object
+# inspection and manipulation, history, patch generation
+# and more. You should be able to do most fundamental git
+# operations with this library.
+#
+# This module provides the basic functions to open a git
+# reference to work with. You can open a working directory,
+# open a bare repository, initialize a new repo or clone an
+# existing remote repository.
+#
+# Author:: Scott Chacon (mailto:schacon@gmail.com)
+# License:: MIT License
module Git
VERSION = '1.0.2'
+ # open a bare repository
+ #
+ # this takes the path to a bare git repo
+ # it expects not to be able to use a working directory
+ # so you can't checkout stuff, commit things, etc.
+ # but you can do most read operations
def self.bare(git_dir)
Base.bare(git_dir)
end
+ # open an existing git working directory
+ #
+ # this will most likely be the most common way to create
+ # a git reference, referring to a working directory.
+ # if not provided in the options, the library will assume
+ # your git_dir and index are in the default place (.git/, .git/index)
+ #
+ # options
+ # :repository => '/path/to/alt_git_dir'
+ # :index => '/path/to/alt_index_file'
def self.open(working_dir, options = {})
Base.open(working_dir, options)
end
+ # initialize a new git repository, defaults to the current working directory
+ #
+ # options
+ # :repository => '/path/to/alt_git_dir'
+ # :index => '/path/to/alt_index_file'
def self.init(working_dir = '.', options = {})
Base.init(working_dir, options)
end
+ # clones a remote repository
+ #
+ # options
+ # :bare => true (does a bare clone)
+ # :repository => '/path/to/alt_git_dir'
+ # :index => '/path/to/alt_index_file'
+ #
+ # example
+ # Git.clone('git://repo.or.cz/rubygit.git', 'clone.git', :bare => true)
+ #
def self.clone(repository, name, options = {})
Base.clone(repository, name, options)
end