The sync command updates worktrees with changes from their upstream branches, keeping feature branches current with the main codebase.
Usage
bash
owt sync [name] [OPTIONS]Arguments
| Argument | Description |
|---|---|
name | Worktree name to sync (optional when using --all) |
Options
| Option | Description |
|---|---|
--all | Sync all worktrees |
--json | Output results in JSON format |
Sync Strategies
Open Orchestrator uses these strategies when syncing:
| Strategy | Description |
|---|---|
merge | Merge upstream into branch (default) |
auto_stash | Automatically stash and restore uncommitted changes |
prune_remote | Prune deleted remote branches |
Examples
Sync a Single Worktree
bash
owt sync add-authSync All Worktrees
bash
owt sync --allJSON Output
bash
owt sync --all --jsonOutput:
json
{
"results": [
{
"worktree": "add-auth",
"status": "success"
},
{
"worktree": "api-v2",
"status": "up_to_date"
},
{
"worktree": "fix-nav",
"status": "conflicts"
}
]
}Sync Statuses
Each worktree sync returns one of these statuses:
| Status | Description |
|---|---|
success | Synced successfully with new changes |
up_to_date | Already up to date, nothing to do |
conflicts | Merge conflicts detected, manual resolution required |
no_upstream | Branch has no upstream configured |
uncommitted_changes | Cannot sync due to uncommitted changes |
error | An unexpected error occurred |
Conflict Resolution
When a sync results in conflicts:
bash
# Switch to the worktree
owt switch add-auth
# Check which files have conflicts
git status
# Fix conflicts in your editor, then:
git add .
git commit -m "Resolve merge conflicts with upstream"Use Cases
Morning Sync
bash
# Start of day - sync all worktrees with upstream
owt sync --allBefore Merging
bash
# Sync before merging to catch conflicts early
owt sync add-auth
owt merge add-authCI/CD Integration
bash
# Use JSON output to check for issues
owt sync --all --json | jq '.results[] | select(.status == "conflicts")'