Skip to content

Delete a reference

DELETE
/repos/{owner}/{repo}/git/refs/{ref}

Deletes the provided reference.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

ref
required
string

The Git reference. For more information, see “Git References” in the Git documentation.

Example
heads/feature-a

Response

Conflict

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Validation failed, an attempt was made to delete the default branch, or the endpoint has been spammed.