Prerequisites
A Stencila workspace initialized with stencila init(this creates stencila.tomlwith a workspace.id) Authentication with Stencila Cloud ( stencila signin) A git repository (the manifest file is tracked by git)
First-time push
stencila db push -m "initial state".stencila/db.json
git add .stencila/db.json
git commit -m "Add workspace db state"
git pushPulling database state
git pull
stencila db pullpull
Ongoing push/pull workflow
Make changes locally (run workflows, etc.) Push the changes: stencila db push -m "add batch-2 results"Subsequent pushes upload only the incremental changes (a changeset), not the entire database. If nothing has changed, push detects this and skips. Commit the updated manifest: git add .stencila/db.json git commit -m "Update db state" git pushCollaborators pull: git pull stencila db pull
Checking sync status
stencila db statusViewing history
stencila db logCompacting history
stencila db snapshot -m "compact after batch processing"
git add .stencila/db.json
git commit -m "Compact db history"
git pushTeam collaboration
Single producer, many consumers
Multiple contributors
Person A pushes and commits the manifest. Person B makes local changes, then tries to push: stencila db push -m "my changes" git add .stencila/db.json git commit -m "Update db state" git push # ← often fails as non-fast-forward (manifest changed upstream)Person B resolves by pulling the latest: git pull # gets Person A's manifest stencila db pull # applies Person A's changesets stencila db push -m "my changes" # re-diffs against updated state git add .stencila/db.json git commit -m "Update db state" git pushBecause changesets are computed by diffing the current database against the manifest head (not accumulated in a persistent session), the second push correctly captures only the new differences.
PR-based workflow
Create a branch, run workflows, push, and commit the manifest. Open a PR. Reviewers can see the manifest diff (changeset hashes and messages). After merge, collaborators git pulland stencila db pullon the main branch.
Branch switching
git checkoutstencila db status
stencila db reset