Merge one branch into another usingDocumentation Index
Fetch the complete documentation index at: https://code.storage/docs/llms.txt
Use this file to discover all available pages before exploring further.
merge, ff_only, or ff_prefer.
Request Body
Source branch name. Pass a plain branch name, not a full
refs/... path.When
true, resolves source_branch under refs/namespaces/ephemeral/refs/heads/<source_branch>.Target branch name. Pass a plain branch name, not a full
refs/... path.When
true, resolves target_branch under refs/namespaces/ephemeral/refs/heads/<target_branch>.Merge strategy. Must be one of
merge, ff_only, or ff_prefer.Optional optimistic concurrency guard. The merge is rejected if the current target tip does not match this SHA.
Commit message for merge-commit results. Required when the backend needs to create a merge commit.
Commit author object with
name and email. Required when the backend needs to create a merge commit.Optional committer object with
name and email. Defaults to author when omitted.When
true, allows merging branches with no common ancestor.JWT Requirements
- The JWT must include the repository in the
repoclaim - Requires
git:writescope
Response
Response Fields
Merge outcome:
merge_commit, fast_forward, no_op, or unknown.Commit SHA for the merge result. For a fast-forward or no-op, this is the resulting target tip.
Tree SHA for the resulting commit or target tip.
Source ref metadata with
branch, ephemeral, and resolved sha.Target ref metadata with
branch, ephemeral, previous old_sha, and resulting new_sha.Merge base SHA when one exists and the backend reports it.
Number of commits promoted from source onto target.
Conflict Response
When the merge has conflicts, the API returns409 Conflict with the conflicting paths and merge base:
Notes
source_branchandtarget_branchare branch names, not arbitrary refs.- The ephemeral flags are namespace selectors. They tell the backend to resolve the branch under the ephemeral namespace before merging.
ff_onlyrejects non-fast-forward merges.ff_preferfast-forwards when possible and falls back to a merge commit when necessary.commit_messageandauthorare only required when the backend creates a merge commit. They are not required for a pure fast-forward orno_opresult.- On connected GitHub-backed repositories, ephemeral-to-default merges are handled as third-party-safe promotions so the returned pack includes source ancestry when needed.
Error Responses
Invalid request body, invalid strategy, invalid branch name, or source and target resolving to the same branch.
Invalid JWT or missing authorization header.
Missing
git:write scope.Repository or branch not found.
Merge conflict or expected target SHA mismatch.
Non-fast-forward merge rejected by
ff_only, or unrelated histories rejected without allow_unrelated_histories.The generated merge pack exceeded backend size limits.
Storage returned an invalid merge-pack stream.
Storage coordination or repository runtime was unavailable.