> ## 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` and move `target` to the merge result.

**Required scope: `write`**

```ts theme={null}
const result = await mesa.bookmarks.merge({
  repo: 'app',
  target: 'main',
  source: 'feature/auth',
  delete_source: true,
});

console.log(result.merge_type, result.change_id);
```

Resolve conflicts by retrying with resolutions:

```ts theme={null}
await mesa.bookmarks.merge({
  repo: 'app',
  target: 'main',
  source: 'feature/auth',
  resolutions: [{ path: 'README.md', take: 'source' }],
});
```

## Options

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

<ParamField path="target" type="string" required>
  Bookmark being merged into. This bookmark is updated to the merge result.
</ParamField>

<ParamField path="source" type="string" required>
  Bookmark being merged from.
</ParamField>

<ParamField path="org" type="string | undefined">
  Organization override.
</ParamField>

<ParamField path="delete_source" type="boolean | undefined">
  Delete the source bookmark after a successful merge. Defaults to `false`.
</ParamField>

<ParamField path="allow_conflicted" type="boolean | undefined">
  Persist a conflicted merge commit instead of rejecting with `MERGE_CONFLICT`. Defaults to `false`.
</ParamField>

<ParamField path="resolutions" type="array | undefined">
  Conflict resolutions to apply before conflict detection. Each resolution targets a path and either supplies whole-file `content`, takes `target` or `source`, or resolves individual hunks.
</ParamField>

## Response

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

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

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

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

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

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

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