Delete a Git Branch

Version 4.0.26.2 (latest)

Delete the specified Git Branch

Delete git branch specified in branch_name path param from local and remote of specified project repository

Request

DELETE/projects/{project_id}/git_branch/{branch_name}
Datatype
Description
Request
HTTP Request
path
HTTP Path
Expand HTTP Path definition...
project_id
string
Project Id
branch_name
string
Branch Name

Response

204: Successfully deleted.

Datatype
Description
(string)
string

400: Bad Request

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

404: Not Found

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

429: Too Many Requests

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-09 UTC.