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 (schacon@gmail.com) |
License: | MIT License |
VERSION | = | '1.0.4' |
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)
Export the current HEAD (or a branch, if options[:branch] is specified) into the name directory, then remove all traces of git from the directory.
See clone for options. Does not obey the :remote option, since the .git info will be deleted anyway; always uses the default remote, ‘origin.’
Same as g.config, but forces it to be at the global level
g.config(‘user.name’, ‘Scott Chacon’) # sets value g.config(‘user.email’, ‘email@email.com’) # sets value g.config(‘user.name’) # returns ‘Scott Chacon’ g.config # returns whole config hash
initialize a new git repository, defaults to the current working directory
options
:repository => '/path/to/alt_git_dir' :index => '/path/to/alt_index_file'
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'
g.config(‘user.name’, ‘Scott Chacon’) # sets value g.config(‘user.email’, ‘email@email.com’) # sets value g.config(‘user.name’) # returns ‘Scott Chacon’ g.config # returns whole config hash