def push_to_remote(local_branch, remote_branch, remote_name, opts)
      remote_name ||= 'origin'

      args = [remote_name]

      local_branch ||= branches.current
      remote_branch ||= local_branch
      args << '-f' if opts[:force]

      logger.info do
        if local_branch == remote_branch
          "Pushing to '#{remote_branch}' on '#{remote_name}'."
        else
          "Pushing #{local_branch} to '#{remote_branch}' on '#{remote_name}'."
        end
      end

      args << "#{local_branch}:#{remote_branch}"
      return command(:push, args)
    end
def push_to_remote(local_branch, remote_branch, remote_name, opts)
      remote_name ||= 'origin'

      args = [remote_name]

      local_branch ||= branches.current
      remote_branch ||= local_branch
      args << '-f' if opts[:force]

      logger.info do
        if local_branch == remote_branch
          "Pushing to '#{remote_branch}' on '#{remote_name}'."
        else
          "Pushing #{local_branch} to '#{remote_branch}' on '#{remote_name}'."
        end
      end

      args << "#{local_branch}:#{remote_branch}"
      return command(:push, args)
    end
Pushes the given branch to the server.

 @param [String] remote_name the repository name; nil -> 'origin'
 @param [String] local_branch the local branch to push; nil -> the current branch
 @param [String] remote_branch the name of the branch to push to; nil -> same as local_branch

 @option opts [Boolean] :force force the update, even if not a fast-forward?

 @return [String] the output of the push command