Skip to main content

remote_branch_exists

Function remote_branch_exists 

Source
pub async fn remote_branch_exists(
    repo_path: PathBuf,
    remote_branch_name: String,
) -> Result<bool, GitError>
Expand description

Re-exported commit/sync/diff APIs. Checks whether a branch already exists on the remote.

Resolves the remote name from the current branch config, falling back to origin, then runs git ls-remote --heads <remote> <branch>. Returns true when the remote reports at least one matching ref.

§Arguments

  • repo_path - Path to the git repository or worktree
  • remote_branch_name - Branch name to look up on the remote

§Errors

Returns a GitError if the git ls-remote command fails.