Skip to main content
Branch names must not start with refs/. The repository’s default branch cannot be deleted. This protection only applies to non-ephemeral branches — an ephemeral branch that shares the same short name as the default branch can still be deleted.

Options

string
required
Branch name to delete (e.g. feature/old-onboarding). Must not start with refs/.
boolean
Delete from the ephemeral namespace instead of the default namespace (default: false). Use this to clean up branches created with ephemeral: true.
object[]
Ordered ref policy rules ({ pattern, ops? }) in the JWT for this call. Code Storage uses the first rule that matches the target ref. Python: ref_policies. Go: RefPolicies with type storage.RefPolicyList. See Ref Policies.

Response

string
The deleted branch name.
boolean
Whether the deleted branch was in the ephemeral namespace.
string
Confirmation message from the API.