GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → deleteApiV4ProjectsIdRepositoryFilesFilePath

AI-generated

Summary

Delete a specific file from a GitLab project's repository by specifying the project ID, file path, target branch, and a commit message to record the change.

Inputs

  • id (required) — The project ID or namespace/project path identifying the target GitLab project.
  • file_path (required) — The URL-encoded path to the file to delete within the repository.
  • branch (required) — The branch name where the file deletion commit should be applied.
  • commit_message (required) — A commit message describing the deletion operation.
  • start_branch — Optional. The name of the branch from which to start a new branch if branch creation is desired.
  • author_email — Optional. The email address of the commit author.
  • author_name — Optional. The name of the commit author.

Output shape

a JSON object representing the commit that deleted the file, including relevant metadata from the GitLab API response

The operation performs an HTTP DELETE request to the GitLab API's repository files endpoint. It requires all mandatory parameters to be set. Optional parameters can be used to customize commit author details and branch creation behavior if applicable.

Links

Discussion