public function remoteRefExists($url, $ref = null, $heads = true)
    {
        $args = ['ls-remote', $url];
        if ($heads) {
            $args[] = '--heads';
        }
        if ($ref !== null) {
            $args[] = $ref;
        }
        $result = $this->execute($args, false, true);

        return !is_bool($result) && strlen($result) > 0;
    }