async function getBranches(repositoryUrl, execaOptions) {
  return (await execa("git", ["ls-remote", "--heads", repositoryUrl], execaOptions)).stdout
    .split("\n")
    .filter(Boolean)
    .map((branch) => branch.match(/^.+refs\/heads\/(?<branch>.+)$/)[1]);
}
Get all the repository branches.

@param {String} repositoryUrl The remote repository URL.
@param {Object} [execaOpts] Options to pass to `execa`.

@return {Array<String>} List of git branches.
@throws {Error} If the `git` command fails.