class Silo::Remote::Git
This class represents a standard Git
remote attached to the Git
repository backing the Silo
repository
@see Repository
Public Class Methods
new(repo, name, url)
click to toggle source
Creates a new Git
remote
@param [Repository] repo The Silo
repository this remote belongs to @param [String] name The name of the remote @param [String] url The URL of the remote Git
repository. This may use
any protocol supported by Git (+git:+, +file:+, +http(s):+)
Calls superclass method
Silo::Remote::Base::new
# File lib/silo/remote/git.rb, line 24 def initialize(repo, name, url) super repo, name @url = url end
Public Instance Methods
add()
click to toggle source
Adds this remote as a mirror to the backing Git
repository
# File lib/silo/remote/git.rb, line 31 def add @repo.git.git.remote({}, 'add', '--mirror', @name, @url) end
push()
click to toggle source
Pushes the current history of the repository to the remote repository using ‘git push`
# File lib/silo/remote/git.rb, line 37 def push @repo.git.git.push({}, @name) end
remove()
click to toggle source
Removes this remote from the backing Git
repository
# File lib/silo/remote/git.rb, line 42 def remove @repo.git.git.remote({}, 'rm', @name) end