1.0.4 taggings
[rubygit.git] / lib / git.rb
blob7c13d1a3191007c1e0b0ba17d6a5681938e16d12
2 # Add the directory containing this file to the start of the load path if it
3 # isn't there already.
4 $:.unshift(File.dirname(__FILE__)) unless
5   $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
7 require 'git/base'
8 require 'git/path'
9 require 'git/lib'
11 require 'git/repository'
12 require 'git/index'
13 require 'git/working_directory'
15 require 'git/log'
16 require 'git/object'
18 require 'git/branches'
19 require 'git/branch'
20 require 'git/remote'
22 require 'git/diff'
23 require 'git/status'
24 require 'git/author'
26 # Git/Ruby Library
28 # This provides bindings for working with git in complex
29 # interactions, including branching and merging, object
30 # inspection and manipulation, history, patch generation
31 # and more.  You should be able to do most fundamental git
32 # operations with this library.
34 # This module provides the basic functions to open a git 
35 # reference to work with. You can open a working directory,
36 # open a bare repository, initialize a new repo or clone an
37 # existing remote repository.
39 # Author::    Scott Chacon (mailto:schacon@gmail.com)
40 # License::   MIT License
41 module Git
43   VERSION = '1.0.4'
44   
45   # open a bare repository
46   #
47   # this takes the path to a bare git repo
48   # it expects not to be able to use a working directory
49   # so you can't checkout stuff, commit things, etc.
50   # but you can do most read operations
51   def self.bare(git_dir)
52     Base.bare(git_dir)
53   end
54     
55   # open an existing git working directory
56   # 
57   # this will most likely be the most common way to create
58   # a git reference, referring to a working directory.
59   # if not provided in the options, the library will assume
60   # your git_dir and index are in the default place (.git/, .git/index)
61   #
62   # options
63   #   :repository => '/path/to/alt_git_dir'
64   #   :index => '/path/to/alt_index_file'
65   def self.open(working_dir, options = {})
66     Base.open(working_dir, options)
67   end
69   # initialize a new git repository, defaults to the current working directory
70   #
71   # options
72   #   :repository => '/path/to/alt_git_dir'
73   #   :index => '/path/to/alt_index_file'
74   def self.init(working_dir = '.', options = {})
75     Base.init(working_dir, options)
76   end
78   # clones a remote repository
79   #
80   # options
81   #   :bare => true (does a bare clone)
82   #   :repository => '/path/to/alt_git_dir'
83   #   :index => '/path/to/alt_index_file'
84   #
85   # example
86   #  Git.clone('git://repo.or.cz/rubygit.git', 'clone.git', :bare => true)
87   #
88   def self.clone(repository, name, options = {})
89     Base.clone(repository, name, options)
90   end
91     
92 end