Fast-forward an entity from one branch to another
POST /Platform/entities/{entity_type}/{entity_id}/fast-forward
Fast-forward an entity from one branch to another.
The git merge --ff-only equivalent: succeeds only when
to_branch's head is an ancestor of (or equal to) from_branch's
head, i.e. nothing on to_branch would be lost. No new commit is
created — the to_branch pointer is moved to from_branch's head
commit, so both branches share one lineage afterwards. This is the
single-entity promote step for the standard branch workflow documented
by merge-branch.
If the branches have diverged (both have independent commits), this
is a 409 carrying the diff (diff/changed_fields in the error
body), and nothing is written.
Resolve by restoring one side (restore) or re-applying changes,
then fast-forward again.
Use dry_run=true to preview: reports whether the fast-forward is
possible and returns the diff, without writing anything.
Path parameters
entity_type: str. Entity class name.entity_id: str. Entity id to promote.
Body parameters
from_branch: str. Branch whose head to promote (e.g.dev).to_branch: optional str. Branch to move (defaultmain).dry_run: optional bool. If True, only check and diff — never write.include_diff: optional bool. If True (default), include the unified YAML diff (to_branch->from_branch) in the response for review.
Returns
FastForwardResponse
entity_type: optional str or null. Entity class name.entity_id: optional str or null. Entity id.from_branch: optional str or null. Branch whose head was promoted.to_branch: optional str or null. Branch that was moved.fast_forwarded: optional bool. True only when the branch was actually moved.dry_run: optional bool. True when nothing was written.commit_id: optional str or null. Head of to_branch afterwards (or the commit it would move to, on a dry run).diff: optional str or null. Unified diff from to_branch to from_branch.changed_fields: optional List[str] or null. Top-level fields that differ.
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/{entity_type}/{entity_id}/fast-forward" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'