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

# bookmarks.merge()

> Merge one bookmark into another.

Merge `source` into `target`. The target bookmark advances to the merge result.

**Required scope: `write`**

```python theme={null}
result = await mesa.bookmarks.merge(
    repo="app",
    source="feature-x",
    target="main",
    delete_source=True,
)
print(result.merge_type, result.change_id)
```

Resolve conflicts on retry:

```python theme={null}
from mesa_sdk import WholeFileResolution

result = await mesa.bookmarks.merge(
    repo="app",
    source="feature-x",
    target="main",
    resolutions=[WholeFileResolution(path="README.md", take="source")],
)
```

## Options

<ParamField path="repo" type="str" required>
  Repository name.
</ParamField>

<ParamField path="source" type="str" required>
  Source bookmark with changes to merge.
</ParamField>

<ParamField path="target" type="str" required>
  Target bookmark to advance.
</ParamField>

<ParamField path="delete_source" type="bool | None">
  Delete the source bookmark after a successful merge.
</ParamField>

<ParamField path="allow_conflicted" type="bool | None">
  When `True`, accept a merge that still contains textual conflicts. When omitted or `False`, conflicted merges fail with `ConflictError`.
</ParamField>

<ParamField path="resolutions" type="list[Resolution] | None">
  Whole-file or per-hunk conflict resolutions applied before conflict detection.
</ParamField>

<ParamField path="org" type="str | None">
  Organization override.
</ParamField>

## Response

<ResponseField name="merge_type" type="'merge_commit' | 'no_op'">
  Type of merge that was performed.
</ResponseField>

<ResponseField name="is_conflicted" type="bool">
  Whether the resulting merge change still contains unresolved conflicts.
</ResponseField>

<ResponseField name="commit_oid" type="str">
  Commit OID the target bookmark now points to.
</ResponseField>

<ResponseField name="change_id" type="str">
  Change ID the target bookmark points to after the merge.
</ResponseField>

<ResponseField name="target" type="str">
  Bookmark that was merged into.
</ResponseField>

<ResponseField name="source" type="str">
  Bookmark that was merged from.
</ResponseField>

<ResponseField name="source_deleted" type="bool">
  Whether the source bookmark was deleted after the merge.
</ResponseField>
