Keep a repository synced continuously

sync --watch, and what auto-integration will not do.

Written By Dustin

Last updated 19 minutes ago

tovio sync --watchtovio sync --watch --interval 300tovio sync --watch --once

Runs a poll loop in the foreground, syncing as work appears rather than when you remember to. Stop it with Ctrl-C.

It always uses the saved origin

--watch deliberately refuses to be combined with an explicit remote, repository, --cert, --push, --pull, or --isolate. Those are rejected as a usage error rather than silently ignored, so a watch loop can never be pointed somewhere you did not mean.

FlagEffect
--interval <secs>Seconds between polls. Defaults to sync.auto.interval (120), and is floored at 5 so a typo cannot turn it into a handshake storm.
--onceRun a single poll and return. For scripts and tests.

What each poll does

  1. Checks the working copy. A dirty tree is skipped rather than clobbered — nothing is ever materialized over uncommitted work.
  2. Pulls, merging refs convergently.
  3. Integrates the current lane's upstream, only when conflict-free.
  4. Pushes, subject to the auto-push consent setting.

What a poll deliberately does not do

A background pull is last-writer-wins only. Unlike a manual tovio sync, it will not join two diverged tips into a reconciliation commit — an unattended pull must never materialize a conflict onto your working copy. A lane that has genuinely diverged stays diverged until you run tovio sync or tovio land yourself, so do not read a quiet watch loop as “nothing to reconcile”.

Upstream integration is skipped entirely on a promisor-backed (partial) clone and on a sparse or coned checkout, because it materializes the merged tip over the full working copy. Those repositories integrate with an explicit tovio land.

Automatic integration is conservative

Where a lane has an upstream — the lane it will land onto, defaulted to the lane it was branched from — TOVIO folds incoming work in automatically, but only when the fold produces no conflict. Anything that would conflict is left for a manual tovio land. A protected lane is never advanced automatically.

That boundary is the point: continuous sync removes the bookkeeping without removing your judgement about disagreements.

Push is not automatic by default

The push leg is consent-gated by sync.auto.push, which defaults to shared: only the current lane, only after you have published that lane manually at least once, and never a protected lane. If you expected a watch loop to publish a brand-new lane and it did not, that is why. See the auto-sync tuning article.

When to run it

  • Working across two machines on the same lane.
  • A repository several agents are committing into.
  • Long sessions where you would otherwise forget to sync.

When not to

On a metered or unreliable connection, run sync explicitly. Watch mode transfers as work appears.

Stopping it

Interrupt the process. Each poll takes the repository write lock only transiently, so nothing is left half-applied.