public function push($repository = 'origin', $ref = 'HEAD', $setUpstream = false) {
    $command = $this->getResettedCommandBuilder()->addSubcommand('push')->addParam($repository)->addParam($ref);
    if($setUpstream) {
      $command->addFlag('u');
    }
    $this->getRunnerWithDirectory()->run($command);
    return $this;
  }