GitLab API

GitlabTool

Actions1095

Branches → headApiV4ProjectsIdRepositoryBranchesBranch

AI-generated

Summary

Send a HEAD request to check the existence and accessibility of a specific branch in a GitLab project repository identified by project ID or path and branch name.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project to check the branch in.
  • branch (required) — The name of the branch to check within the specified GitLab project.
  • skipAuthentication — Whether to skip authentication for the request; defaults to false, requiring authentication.
  • baseUrl — The base URL of the GitLab instance; defaults to https://gitlab.com.

Output shape

no body — success/failure only

The operation returns an HTTP HEAD response indicating the branch existence. No response body is returned; users should infer branch status from the HTTP status code (e.g., 200 for exists, 404 for not found). Supports authentication unless skipped.

Examples

Example 1: Check if a branch exists in a project

Set 'Method' to 'HEAD', provide project 'id' and 'branch' name in 'Path Parameters', ensure authentication is enabled.

Links

Discussion