Delete a file
delete_fileDeletes a file in a Forgejo repository as a single commit using the current blob SHA, optionally targeting a branch or creating a new one. Use it to remove files via the API.
Instructions
Delete a file as a single commit (owner/repo/path/sha; requires write mode). sha is the file's current blob SHA from get_file_contents; a stale one is refused. Commits to branch (default: the default branch), or to new_branch created from it. Answers with the commit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | Yes | The file's current blob SHA, from `get_file_contents`. | |
| path | Yes | File path from the repository root. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner. | |
| branch | No | Branch to commit to. Defaults to the repository's default branch. | |
| message | No | Commit message. The forge composes one when absent. | |
| new_branch | No | Create this branch from `branch` and commit the deletion there instead. |