website/docs/cli-reference/sync.md
Commands for synchronizing with Dolt.
Push changes to a Dolt remote.
bd dolt push [flags]
What it does:
Examples:
bd dolt push
When to use:
Pull changes from a Dolt remote.
bd dolt pull [flags]
What it does:
Examples:
bd dolt pull
When to use:
Export database to JSONL format (for backup and migration).
bd export [flags]
Flags:
--output, -o Output file (default: stdout)
--dry-run Preview without writing
--json JSON output
Examples:
bd export
bd export -o backup.jsonl
bd export --dry-run
When to use: bd export is for backup and data migration, not day-to-day sync. Dolt handles sync natively via bd dolt push/bd dolt pull.
Migrate database schema.
bd migrate [flags]
Flags:
--inspect Show migration plan (for agents)
--dry-run Preview without changes
--cleanup Remove old files after migration
--yes Skip confirmation
--json JSON output
Examples:
bd migrate --inspect --json
bd migrate --dry-run
bd migrate
bd migrate --cleanup --yes
Manage git hooks.
bd hooks <subcommand> [flags]
Subcommands:
| Command | Description |
|---|---|
install | Install git hooks |
uninstall | Remove git hooks |
status | Check hook status |
Examples:
bd hooks install
bd hooks status
bd hooks uninstall
When the Dolt server is running, sync is handled automatically:
Start the Dolt server with bd dolt start.
In CI/CD pipelines and ephemeral environments, no server is needed:
bd create "CI-generated task"
bd dolt push # Manual push needed
Dolt handles conflict resolution at the database level using its built-in
merge capabilities. When conflicts arise during bd dolt pull, Dolt identifies
conflicting rows and allows resolution through SQL.
# Check for conflicts after pull
bd doctor --fix
Deletions are tracked in the Dolt database:
# Delete issue
bd delete bd-42
# View deletions
bd deleted
bd deleted --since=30d
# Deletions propagate via Dolt push
bd dolt push
bd dolt pushbd dolt pullbd hooks installbd info shows sync state