Commit files to repository
commit_repo_filesWRITE files to the repository in one commit: create, overwrite entirely or delete. ⚠️ Writes to the branch on behalf of the caller and immediately: the commit appears in shared history, the push starts a CI run, and it can be undone only by a reverting commit. createNewBranch=false WRITES TO AN EXISTING BRANCH: name main and the change goes straight into main, bypassing review. BRANCH PROTECTION DOES NOT APPLY HERE: this endpoint places the commit bypassing the check that guards a regular git push, so "the branch is protected" will not stop you; there is also no tool to read the protection rules, so ask a person. Safe order: createNewBranch=true + sourceBranch, then create_code_review. Content is TEXT; binary files cannot be uploaded this way
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectKey": "<projectKey>",
"repoName": "<repoName>",
"branch": "<branch>",
"message": "<message>",
"files": "<files>"
},
"name": "commit_repo_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Files of one commit. DELETE is possible only when the list has ONE file: the server's batch write cannot delete | |
| branch | Yes | Where the commit goes. createNewBranch=true: the name of a NEW branch (the server creates it); otherwise the name of an EXISTING branch to write to. A slash is fine (feature/x) | |
| message | Yes | Commit message | |
| repoName | Yes | Repository name (list_repositories) | |
| projectKey | Yes | Project key, e.g. C4SPACE. Also accepts org/KEY (e.g. code4space/C4SPACE), as in a new-form web address; org (case-insensitive) must be your organization's slug or a former slug of it, otherwise the call is refused | |
| sourceBranch | No | Branch to fork the new one from. REQUIRED when createNewBranch=true | |
| createNewBranch | No | true: create a new branch named branch, forking it from sourceBranch. false/omitted: write to the existing branch named branch |