DELETE
/repos/{owner}/{repo}/git/refs/{ref}Delete a Git reference
Deletes a Git reference from a repository. Supply owner, repo, and ref to identify the repository and reference, but do not target the repository's default branch. A successful 204 response contains no response body.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
refstringrequired
The Git reference to delete, such as a branch or tag reference.
204Returns no response body after successfully deleting the Git reference.
409Returned when the reference cannot be deleted because of a conflict.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails, an attempt is made to delete the default branch, or the endpoint has been spammed.
Error handling
A 409 is returned when the reference cannot be deleted because of a conflict. A 422 is returned when validation fails, when ref identifies the default branch, or when the endpoint has been spammed.