Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit61a33237e0

README.md

zm.push

Publish unpushed commits to ZeroMind, making the world's content available to others. Like a git push, it walks the parent chain from the current commit and publishes the whole unpushed stack oldest-first, so no commit lands before its parent. It returns { commitId, verdict }: verdict is "published" with the final published commit id in commitId, or "already-published" when the remote branch already carries every local commit — the state a push asks for, so it comes back as a result rather than a failure.

A push only moves the remote branch forward, as git's does: a remote head the branch does not hold is git's ! [rejected] <branch> -> <branch> (fetch first) and one the branch is behind is (non-fast-forward), so pull first. force = true is git push --force: a published head moves the remote branch regardless, which needs the Maintainer role on the world; a branch with unpublished commits is refused, so pull first.

A refused publish comes back as a failed result rather than aborting the caller, so the reason is inspectable: network errors, a parent that has not been pushed yet, access denials, sign-in problems (which name whether you were never signed in or your sign-in expired, and the recovery step — commits stay local and publish after re-auth). Authentication is read from the credential store; scripts never see the token.