Delete a file in a repository
DELETE
/api/v4/projects/{id}/repository/files/{file_path}
Deletes a specified file in a repository. Use the Commits API to delete multiple files with a single request.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” id
required
string
The project ID
Example
gitlab-org/gitlab file_path
required
string
The URL-encoded path to the file.
Example
lib%2Fclass%2ErbQuery Parameters
Section titled “ Query Parameters ” branch
required
string
Name of the branch to commit into. To create a new branch, also provide start_branch.
Example
main commit_message
required
string
Commit message
Example
Initial commit start_branch
string
Name of the branch to start the new commit from
Example
main author_email
string
The email of the author
Example
johndoe@example.com author_name
string
The name of the author
Example
John Doe last_commit_id
string
Last known file commit id
Example
2695effb5807a22ff3d138d593fd856244e155e7Responses
Section titled “ Responses ”No Content
Bad Request
Not Found