Merge a thread's work
When a thread’s work is ready, Merge (top right of the thread) lands its branch on its target, the branch it merges into, usually the one it started from. The thread stays open: work on and merge again, or archive it when it’s finished.
Merging is local. Cohort never pushes; push from your own tools when you want to.
What Merge does
Section titled “What Merge does”- Queues behind any other merge into the same branch (“Queued to merge, 2nd”).
- Catches up (“Catching up”). If the branch already contains the target and nothing is uncommitted, this step is skipped. Otherwise the thread’s agent takes a turn: it commits any uncommitted work, rebases onto the target (or merges it in), resolves conflicts and makes sure it builds and its tests pass.
- Runs the project’s checks (“Running checks”), if it has any. A failure stops the merge.
- Lands (“Landing”): the target moves forward to the thread’s branch. Nothing is rewritten on the target. If the target is checked out somewhere (your checkout, another thread’s folder), Cohort waits for any turn running there (“Waiting for your checkout”), and git refuses rather than overwrite your uncommitted changes.
When it lands, the thread’s header says “Landed on main 5m ago”, with Undo.
Merge options
Section titled “Merge options”The chevron beside Merge:
- Merge (rebase): the branch is rebased onto the target, for a straight history.
- Merge commit: the target is merged in; nothing is rewritten.
- Extra instructions (optional): added to the agent’s catch-up turn (“keep both migrations”).
The project’s default is ticked. Merging with the other one makes it the project’s default. Cohort uses a merge commit instead of a rebase when rewriting the branch would strand others (the branch was pushed, or another thread started from it).
Branch status
Section titled “Branch status”The header and the thread’s row say how its branch stands:
| Label | Means |
|---|---|
| “3 to merge, 2 behind” | 3 commits not on the target yet; the target has 2 the branch lacks |
| “Uncommitted changes” | Work only in the folder; Merge asks the agent to commit it first |
| “Merged” | Everything is on the target |
| “Merge failed” | The last merge didn’t land; the reason is under the header |
The To merge and Merged filters in the thread list’s Show bar gather them. With Merged shown, the Archive button beside the filter archives every merged thread in the list, after one confirm.
Change where it merges
Section titled “Change where it merges”Click Merges into <branch> in the thread’s header and pick another branch. When a thread targets another thread’s branch and that one lands, Cohort offers “Merge into <target> instead?”.
Cancel or undo
Section titled “Cancel or undo”- Cancel merge stops a merge that’s running. Sending the agent a message, or stopping it, during its catch-up turn cancels it too.
- Undo moves the target back to where it was, as long as nothing else has moved it since.
When Merge isn’t offered
Section titled “When Merge isn’t offered”- “Parent merges this”: the thread is a child and its parent is running; the parent lands it. Once the parent is idle, you can merge it yourself.
- A thread in the project checkout, or sharing another thread’s folder, has no branch of its own to merge.
- While background tasks still run, Merge asks first (“Merge anyway?”).
From the CLI
Section titled “From the CLI”cohort thread merge <id> --wait # exit 1 unless it landscohort thread merge <id> --merge-commit --instructions "Keep both migrations"cohort thread merge <id> --into releasecohort thread merge <id> --cancelcohort thread merge <id> --undo