Skip to main content
GET
TypeScript

Authorizations

Authorization
string
header
required

JWT bearer token signed with your organization's registered signing key. There is no OAuth authorization server; you mint tokens yourself and the token's scopes claim carries the granted permission scopes. Public scopes: git:read (read repository contents), git:write (write branches, commits, tags, and notes), repo:write (create and manage repositories), org:read (list an organization's repositories). Each operation's security requirement names the scopes it requires. See https://code.storage/docs/getting-started/authentication for how to mint tokens.

Scopes

git:read

Path Parameters

repo_name
string
required

The repository name, for example acme/web.

Query Parameters

source_branch
string
required

Source branch to merge from.

target_branch
string
required

Destination branch to preview merging into.

source_is_ephemeral
boolean

Whether source_branch should be resolved from the ephemeral namespace.

target_is_ephemeral
boolean

Whether target_branch should be resolved from the ephemeral namespace.

include_content
boolean

When true, include bounded conflict content in the response.

strategy
enum<string>
default:ff_prefer

Merge strategy to preview, as the strategy of POST /merge. Defaults to ff_prefer.

Available options:
merge,
ff_only,
ff_prefer
squash
boolean
default:false

Preview a squash merge, as the squash of POST /merge. Cannot be used with the ff_only strategy.

allow_unrelated_histories
boolean
default:false

Preview a merge of branches with no common ancestor, as the allow_unrelated_histories of POST /merge.

Response

Merge preview result. Conflicted previews return HTTP 200 with status=conflicted; request and storage failures use normal HTTP errors.

Read-only merge preview result, including clean or conflicted status and optional inline conflict content.

conflict_paths
string[]
required

Repository paths that conflicted during the merge preview.

conflicts
object[]
required

Inline conflict content, populated only when include_content=true.

result
enum<string>
required

The result of POST /merge with the same strategy, squash, and allow_unrelated_histories on the current tips: merge_commit, fast_forward, no_op, squash, or rejected. rejected means that the strategy is ff_only and a fast-forward is not possible: the merge fails with 412.

Available options:
merge_commit,
fast_forward,
no_op,
squash,
rejected
Example:

"merge_commit"

source_branch
string
required

Source branch requested by the caller.

Example:

"feature/preview"

source_tip_sha
string
required

Resolved source branch tip SHA.

Example:

"9eb378bdb5bf1944f6ba0bd5a2c4df3ce32f4df1"

status
enum<string>
required

Whether the tree of the commit that the merge makes has conflicts: clean or conflicted. A no_op, fast_forward, or rejected result makes no commit, so its status is clean.

Available options:
clean,
conflicted
Example:

"conflicted"

target_branch
string
required

Target branch requested by the caller.

Example:

"main"

target_tip_sha
string
required

Resolved target branch tip SHA.

Example:

"c4f0fdfc41adab56630b34f5f4fd4e84a2c5b4d2"

filtered_conflicts
object[]

Conflicts omitted from inline content because of request or server limits.

merge_base_sha
string

Merge base SHA used for the preview.

Example:

"a2d127e6a4d54bb7390de828a99e36411f0c84df"