files

Create a file in a repository

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

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

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The project ID

file_pathstring required

The URL-encoded path to the file.

Request body

filestring binary required

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

Response

Create a file in a repository

Changes

No recorded changes to this operation across all 5 revisions of this API.