create_or_update_file
Create or modify files in GitLab projects by specifying content, path, and commit details to manage repository files through API operations.
Instructions
Create or update a single file in a GitLab project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or complete URL-encoded path to project | |
| file_path | Yes | Path where to create/update the file | |
| content | Yes | Content of the file | |
| commit_message | Yes | Commit message | |
| branch | Yes | Branch to create/update the file in | |
| previous_path | No | Path of the file to move/rename | |
| last_commit_id | No | Last known file commit ID | |
| commit_id | No | Current file commit ID (for update operations) |
Input Schema (JSON Schema)
{
"properties": {
"branch": {
"description": "Branch to create/update the file in",
"type": "string"
},
"commit_id": {
"description": "Current file commit ID (for update operations)",
"type": "string"
},
"commit_message": {
"description": "Commit message",
"type": "string"
},
"content": {
"description": "Content of the file",
"type": "string"
},
"file_path": {
"description": "Path where to create/update the file",
"type": "string"
},
"last_commit_id": {
"description": "Last known file commit ID",
"type": "string"
},
"previous_path": {
"description": "Path of the file to move/rename",
"type": "string"
},
"project_id": {
"description": "Project ID or complete URL-encoded path to project",
"type": "string"
}
},
"required": [
"project_id",
"file_path",
"content",
"commit_message",
"branch"
],
"type": "object"
}