Method: Git::Base#add_remote

Defined in:
lib/git/base.rb

#add_remote(name, url, opts = {}) ⇒ Object

adds a new remote to this repository url can be a git url or a Git::Base object if it’s a local reference

@git.add_remote('scotts_git', 'git://repo.or.cz/rubygit.git')
@git.fetch('scotts_git')
@git.merge('scotts_git/master')

Options:

:fetch => true
:track => <branch_name>


369
370
371
372
373
# File 'lib/git/base.rb', line 369

def add_remote(name, url, opts = {})
  url = url.repo.path if url.is_a?(Git::Base)
  self.lib.remote_add(name, url, opts)
  Git::Remote.new(self, name)
end