GitLab API

GitlabTool

Actions1095

Projects → putApiV4ProjectsIdRepositoryFilesFilePath

AI-generated

Summary

Update an existing file in a GitLab project's repository by specifying the project ID, the URL-encoded file path, and the required update details in the request body.

Inputs

  • Id (required) — The project ID identifying the target GitLab project, either numeric or URL-encoded namespace/project path.
  • File_path (required) — The URL-encoded path to the file in the repository to be updated.
  • Request Body (required) — The body must include the parameters defined by GitLab's API for updating a repository file, such as branch name, file content, commit message, etc.
  • Skip Authentication — Optional boolean to bypass using the GitLab API credentials for authentication.
  • baseUrl — Optional base URL of the GitLab instance to interact with; defaults to https://gitlab.com.

Output shape

a JSON object representing the updated file details as returned by the GitLab API.

The operation makes a PUT request to the path /api/v4/projects/{id}/repository/files/{file_path} and expects the request body to conform to GitLab's file update schema. Requires authentication unless explicitly skipped. The returned data includes confirmation of the updated file state.

Links

Discussion