Class Grit::Git
In: lib/grit/git.rb
Parent: Object

Methods

Included Modules

GitRuby

Classes and Modules

Class Grit::Git::GitTimeout

Attributes

bytes_read  [RW] 
git_binary  [RW] 
git_dir  [RW] 
git_max_size  [RW] 
git_timeout  [RW] 
work_tree  [RW] 

Public Class methods

Public Instance methods

e(str)

Alias for shell_escape

Chmod the the file or dir and everything beneath

  +file+ is the relative path from the Git dir

Returns nothing

Delete a normal file from the filesystem

  +file+ is the relative path from the Git dir

Returns nothing

Check if a normal file exists on the filesystem

  +file+ is the relative path from the Git dir

Returns Boolean

Make a directory

  +dir+ is the relative path to the directory to create

Returns nothing

Move a normal file

  +from+ is the relative path to the current file
  +to+ is the relative path to the destination file

Returns nothing

Read a normal file from the filesystem.

  +file+ is the relative path from the Git dir

Returns the String contents of the file

Write a normal file to the filesystem.

  +file+ is the relative path from the Git dir
  +contents+ is the String content to be written

Returns nothing

Run the given git command with the specified arguments and return the result as a String

  +cmd+ is the command
  +options+ is a hash of Ruby style options
  +args+ is the list of arguments (to be joined by spaces)

Examples

  git.rev_list({:max_count => 10, :header => true}, "master")

Returns String

Bypass any pure Ruby implementations and go straight to the native Git command

Returns String

RAW CALLS WITH ENV SETTINGS

Transform Ruby style options into git command line options

  +options+ is a hash of Ruby style options

Returns String[]

  e.g. ["--max-count=10", "--header"]

[Validate]