class Git::Remote

A remote in a Git repository

Attributes

fetch_opts[RW]
name[RW]
url[RW]

Public Class Methods

new(base, name) click to toggle source
# File lib/git/remote.rb, line 8
def initialize(base, name)
  @base = base
  config = @base.lib.config_remote(name)
  @name = name
  @url = config['url']
  @fetch_opts = config['fetch']
end

Public Instance Methods

branch(branch = @base.current_branch) click to toggle source
# File lib/git/remote.rb, line 26
def branch(branch = @base.current_branch)
  remote_tracking_branch = "#{@name}/#{branch}"
  Git::Branch.new(@base, remote_tracking_branch)
end
fetch(opts = {}) click to toggle source
# File lib/git/remote.rb, line 16
def fetch(opts = {})
  @base.fetch(@name, opts)
end
merge(branch = @base.current_branch) click to toggle source

merge this remote locally

# File lib/git/remote.rb, line 21
def merge(branch = @base.current_branch)
  remote_tracking_branch = "#{@name}/#{branch}"
  @base.merge(remote_tracking_branch)
end
remove() click to toggle source
# File lib/git/remote.rb, line 31
def remove
  @base.lib.remote_remove(@name)
end
to_s() click to toggle source
# File lib/git/remote.rb, line 35
def to_s
  @name
end