> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# repos_merge_branches

> Merge one branch into another directly, without opening a pull request. Answers with the merge commit, an empty object when the base already contains the head, and 409 on a conflict.

<div className="tool-route"><span className="tool-row-method" data-method="POST">POST</span><code>{"https://api.github.com/repos/{owner}/{repo}/merges"}</code></div>

```python github_repos_merge_branches.py theme={null}
from charter.packs import github

result = await github.repos_merge_branches.ainvoke({"owner": ..., "repo": ..., "base": ..., "head": ...})
```

<Note>
  Requires `repo`, `read:user`.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                         | Type     | Description                                                                              |
  | ------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------- |
  | `owner` <span className="required" title="required">\*</span> | `string` | The account owner of the repository. The name is not case sensitive.                     |
  | `repo` <span className="required" title="required">\*</span>  | `string` | The name of the repository without the `.git` extension. The name is not case sensitive. |
</div>

## Body

<div className="reference-table">
  | Field                                                        | Type     | Description                                                                             |
  | ------------------------------------------------------------ | -------- | --------------------------------------------------------------------------------------- |
  | `base` <span className="required" title="required">\*</span> | `string` | The name of the base branch that the head will be merged into.                          |
  | `head` <span className="required" title="required">\*</span> | `string` | The head to merge. This can be a branch name or a commit SHA1.                          |
  | `commitMessage`                                              | `string` | Commit message to use for the merge commit. If omitted, a default message will be used. |
</div>
