Skip to content

Update a file in a repository

PUT
/api/v4/projects/{id}/repository/files/{file_path}

Updates a specified file in a repository. Use the Commits API to update multiple files with a single request.

id
required
string

The project ID

Example
gitlab-org/gitlab
file_path
required
string

The URL-encoded path to the file.

Example
lib%2Fclass%2Erb
Media type multipart/form-data
object
file
required

The file content to be updated (generated by Multipart middleware)

string format: binary
nullable

OK

Bad Request

Not Found