Method: Git::Lib#push
- Defined in:
- lib/git/lib.rb
#push(remote, branch = 'master', opts = {}) ⇒ Object
617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/git/lib.rb', line 617 def push(remote, branch = 'master', opts = {}) # Small hack to keep backwards compatibility with the 'push(remote, branch, tags)' method signature. opts = {:tags => opts} if [true, false].include?(opts) arr_opts = [] arr_opts << '--force' if opts[:force] || opts[:f] arr_opts << remote command('push', arr_opts + [branch]) command('push', ['--tags'] + arr_opts) if opts[:tags] end |