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/gitlabfile_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
maincommit_message
required
string
Commit message
Example
Initial commitstart_branch
string
Name of the branch to start the new commit from
Example
mainauthor_email
string
The email of the author
Example
johndoe@example.comauthor_name
string
The name of the author
Example
John Doelast_commit_id
string
Last known file commit id
Example
2695effb5807a22ff3d138d593fd856244e155e7Responses
Section titled “Responses”No Content
Bad Request
Not Found