# swarmops merge-base

> Release: 0.11.0 · Last changed: 2026-11-09 · Source: https://github.com/KeiaiLab/SwarmOps/blob/stable/docs/reference/commands/merge-base.md

Find where REV forks from ONTO along first parents, and list what REV changed since.

Prints the merge base, both revisions as full ids, and the first page of the unified diff from the base to REV, read in one snapshot. Read the next pages with diff BASE REV-ID --format unified --cursor C: the ids keep them on this base when a ref moves. Revisions that share no first-parent ancestor are E\_INVALID\_ARG.

```yaml
title: "swarmops merge-base"
description: "Find where REV forks from ONTO along first parents, and list what REV changed since."
group: "read"
since: "0.11.0"
mutates: false
identity_required: false
mcp_tool: "merge_base"
envelope_op: "merge_base"
exit_codes: [0]
errors: []
syntax: "swarmops merge-base [OPTIONS] <REV> <ONTO>"
```

## Syntax

```text
swarmops merge-base [OPTIONS] <REV> <ONTO>
```

## Required arguments

### `REV`

Syntax: `<REV>`.

The change's side: the revision whose changes the diff lists.

### `ONTO`

Syntax: `<ONTO>`.

The side it would land on, such as main.

## Optional arguments

The command also takes the [global options](../cli.md#global-options).

### `--limit`

Syntax: `--limit <N>`.
Default: `500`.

The most files of the first page.

### `--max-bytes`

Syntax: `--max-bytes <N>`.
Default: `32768`.

The most bytes of the first page's files, as JSON (the first file comes all the same, its hunks cut to fit).

## Examples

### CLI

No recorded example yet.

### MCP

No recorded example yet.

## Return information

`result` is a `MergeBaseResp` (`swarmops schema MergeBaseResp` prints its JSON Schema).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `base` | `string` | yes | The newest changeset on the first-parent chains of both `rev` and `onto`. |
| `diff` | `Diff` | yes | The first page of the diff from `base` to `rev`. |
| `onto` | `string` | yes | The changeset `onto` named. |
| `rev` | `string` | yes | The changeset `rev` named. |

Envelope `op`: `merge_base`.

Exit codes:

- `0`: Success.

## Errors

No golden step shows this command failing yet.

Any command that opens a store may also fail with a store error, such as [`E_NOT_A_REPO`](../errors.md#e_not_a_repo), [`E_IO`](../errors.md#e_io) or [`E_STORE_CORRUPT`](../errors.md#e_store_corrupt); a command line the grammar refuses is [`E_INVALID_ARG`](../errors.md#e_invalid_arg) (exit 2).

## See also

- [`swarmops blob get`](blob-get.md)
- [`swarmops resolve`](resolve.md)
- [`swarmops cat`](cat.md)
- [`swarmops ls`](ls.md)
- [`swarmops show`](show.md)
- [`swarmops log`](log.md)
- [`swarmops ancestry`](ancestry.md)
- [`swarmops history`](history.md)
- [`swarmops diff`](diff.md)
- [CLI reference](../cli.md)
- [Error codes](../errors.md)
