edit_file
Update a file in a Bitbucket repository by committing new content. Returns commit metadata and supports optimistic locking to prevent conflicts.
Instructions
Edit a file in a repository by committing a new version via the Bitbucket REST API. Returns the commit metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | Yes | Target branch name. | |
| content | Yes | Full new file content as a string. | |
| message | Yes | Commit message. | |
| project | No | Project key. Defaults to BITBUCKET_DEFAULT_PROJECT. | |
| filePath | Yes | Path to the file in the repository. | |
| repository | Yes | Repository slug. | |
| sourceBranch | No | Fork point branch when creating a new branch. | |
| sourceCommitId | No | Current commit ID for optimistic locking. If provided and the branch has advanced, the request will fail with a 409 conflict. |