diff --git a/lib/git/base.rb b/lib/git/base.rb index 50459215..785bfc02 100644 --- a/lib/git/base.rb +++ b/lib/git/base.rb @@ -386,8 +386,8 @@ def each_conflict(&block) # :yields: file, your_version, their_version # @git.pull('upstream') # pulls from upstream/master # @git.pull('upstream', 'develope') # pulls from upstream/develop # - def pull(remote='origin', branch='master') - self.lib.pull(remote, branch) + def pull(remote='origin', branch='master', opts = {}) + self.lib.pull(remote, branch, opts) end # returns an array of Git:Remote objects diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 191b8a74..3dbba64b 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -888,8 +888,13 @@ def push(remote, branch = 'master', opts = {}) end end - def pull(remote='origin', branch='master') - command('pull', remote, branch) + def pull(remote='origin', branch='master', opts = {}) + + arr_opts = [] + arr_opts << '--rebase' if opts[:rebase] + arr_opts << '--allow-unrelated-histories' if opts[:allow_unrelated_histories] + + command('pull', remote, branch, arr_opts) end def tag_sha(tag_name)