Code Storage now supports squash merges through the merge API and SDKs.
Set squash: true on a merge request to collapse the source branch into a single new commit on the
target branch. The new commit uses the current target tip as its only parent, which keeps the target
history compact while still letting agents and automation work across multiple commits before
promotion. By default, it's false.
const result = await repo.merge({
sourceBranch: 'feature/preview',
targetBranch: 'main',
strategy: 'merge',
squash: true,
expectedTargetSha: currentMainSha,
commitMessage: 'Merge feature/preview',
author: { name: 'Merge Bot', email: 'merge@example.com' },
});result = await repo.merge(
source_branch="feature/preview",
target_branch="main",
strategy="merge",
squash=True,
expected_target_sha=current_main_sha,
commit_message="Merge feature/preview",
author={"name": "Merge Bot", "email": "merge@example.com"},
)result, err := repo.Merge(ctx, storage.MergeOptions{
SourceBranch: "feature/preview",
TargetBranch: "main",
Strategy: storage.MergeStrategyMerge,
Squash: true,
ExpectedTargetSHA: currentMainSHA,
CommitMessage: "Merge feature/preview",
Author: &storage.CommitSignature{Name: "Merge Bot", Email: "merge@example.com"},
})Squash merges use the same structured response as regular merges, including source and target commit
metadata, the new commit SHA, and promoted commit count. They are intentionally incompatible with
ff_only, because a squash merge always writes a new commit.
Python and Go surface the squash result label directly. The TypeScript SDK accepts raw squash
responses from the API and normalizes them to merge_commit in the exported result type for 1.x
compatibility.