Check if a branch exists

HEAD /projects/{id}/repository/branches/{branch}

Check if a branch exists

Path parameters

  • id string Required

    The ID or URL-encoded path of the project

  • branch string Required

    The name of the branch

Responses

  • 204

    No Content

  • 404

    Not Found

HEAD /projects/{id}/repository/branches/{branch}
curl \
 --request HEAD 'https://www.gitlab.com/api/v4/projects/{id}/repository/branches/{branch}' \
 --header "Private-Token: $API_KEY"