v5

latestSwagger 2.0MIT2026-08-03485217850.7 KB
repository

Delete a file in a repository

delete/repos/{owner}/{repo}/contents/{filepath}

Path parameters

ownerstring required

owner of the repo

repostring required

name of the repo

filepathstring required

path of the file to delete

Request body

branchstring

branch (optional) is the base branch for the changes. If not supplied, the default branch is used

force_pushboolean

force_push (optional) will do a force-push if the new branch already exists

messagestring

message (optional) is the commit message of the changes. If not supplied, a default message will be used

new_branchstring

new_branch (optional) will make a new branch from base branch for the changes. If not supplied, the changes will be committed to the base branch

shastring required

the blob ID (SHA) for the file to delete

signoffboolean

Add a Signed-off-by trailer by the committer at the end of the commit log message.

Response

FileDeleteResponse

{"stackTrail":"components:schemas:FileDeleteResponse:properties:content","oasType":"schema","type":"unknown","description":"Content is always null for delete operations","extensionFields":{"x-go-name":"Content"}}