GitLab API icon

GitLab API

Gitlab

Actions1062

Branches → deleteApiV4ProjectsIdRepositoryBranchesBranch

AI-generated

Summary

Delete a specific branch from a given GitLab project repository by providing the project ID or URL-encoded path and the branch name.

Inputs

  • Id (required) — The ID or URL-encoded path of the GitLab project from which to delete the branch.
  • Branch (required) — The name of the branch to be deleted from the project repository.
  • Skip Authentication — Optionally skip authentication for this request (default is false).
  • baseUrl — Base URL of the GitLab instance; defaults to 'https://gitlab.com'.
  • Method — HTTP method to use; should be 'DELETE' for branch deletion but is configurable.

Output shape

no body — success/failure only

This operation deletes the branch identified by name in the specified project and returns no response body; success or failure is indicated by the HTTP status code.

Examples

Example 1: Delete branch 'feature-xyz' in project with ID 1234

Set 'Id' to '1234' and 'Branch' to 'feature-xyz', use the DELETE method to remove the branch.

Links

Discussion