Module: RubyGit
- Defined in:
- lib/ruby_git.rb,
lib/ruby_git/error.rb,
lib/ruby_git/version.rb,
lib/ruby_git/worktree.rb,
lib/ruby_git/git_binary.rb,
lib/ruby_git/file_helpers.rb
Overview
RubyGit is an object-oriented wrapper for the git
command line tool for
working with Worktrees and Repositories. It tries to make more sense out
of the Git command line.
Defined Under Namespace
Modules: FileHelpers Classes: Error, GitBinary, Worktree
Constant Summary collapse
- VERSION =
The ruby_git gem version
'0.2.0'
Class Method Summary collapse
-
.clone(repository_url, to_path: '') ⇒ RubyGit::Worktree
Copy the remote repository and checkout the default branch.
-
.git ⇒ RubyGit::GitBinary
Return information about the git binary used by this library.
-
.init(worktree_path) ⇒ RubyGit::Worktree
Create an empty Git repository under the root worktree
path
. -
.open(worktree_path) ⇒ RubyGit::Worktree
Open an existing Git worktree that contains worktree_path.
Class Method Details
.clone(repository_url, to_path: '') ⇒ RubyGit::Worktree
Copy the remote repository and checkout the default branch
Clones the repository referred to by repository_url
into a newly created
directory, creates remote-tracking branches for each branch in the cloned repository,
and checks out the default branch in the worktree whose root directory is to_path
.
to_path
will be created if it does not exist. An error is raised if to_path
exists and
not an empty directory.
101 102 103 |
# File 'lib/ruby_git.rb', line 101 def self.clone(repository_url, to_path: '') RubyGit::Worktree.clone(repository_url, to_path: to_path) end |
.git ⇒ RubyGit::GitBinary
Return information about the git binary used by this library
Use this object to set the path to the git binary to use or to see the path being used.
26 27 28 |
# File 'lib/ruby_git.rb', line 26 def self.git (@git ||= RubyGit::GitBinary.new) end |
.init(worktree_path) ⇒ RubyGit::Worktree
Create an empty Git repository under the root worktree path
If the repository already exists, it will not be overwritten.
45 46 47 |
# File 'lib/ruby_git.rb', line 45 def self.init(worktree_path) RubyGit::Worktree.init(worktree_path) end |
.open(worktree_path) ⇒ RubyGit::Worktree
Open an existing Git worktree that contains worktree_path
62 63 64 |
# File 'lib/ruby_git.rb', line 62 def self.open(worktree_path) RubyGit::Worktree.open(worktree_path) end |