cherry-pick Command
Apply a patch operation from one snapshot to a different target snapshot, enabling cross-branch or cross-snapshot patch reuse.
Usage
batho cherry-pick --root /path/to/repo --patch-id PATCH_ID --target-snapshot SNAPSHOT_ID [options]
Flags
| Flag | Default | Description |
|---|---|---|
--root | required | Path to repository root |
--patch-id | required | Patch operation ID to cherry-pick |
--target-snapshot | required | Target snapshot ID to apply patch to |
--dry-run | off | Preview without applying |
Finding IDs
# List patches to find patch IDs
batho patches --root . --format timeline
# List snapshots to find target snapshot IDs
batho snapshots --root .
Examples
# Cherry-pick a patch to different snapshot
batho cherry-pick --root . \
--patch-id batho_uuid_20260517T120000Z \
--target-snapshot batho_project_target_20260520T100000Z
# Preview cherry-pick before applying
batho cherry-pick --root . \
--patch-id batho_uuid_20260517T120000Z \
--target-snapshot batho_project_target_20260520T100000Z \
--dry-run
# Use short IDs
batho cherry-pick --root . \
--patch-id uuid_20260517 \
--target-snapshot target_20260520
How It Works
- Loads the patch operation from the source
- Validates that the patch can apply to the target snapshot
- Applies the entity/relationship changes to the target
- Creates a new patch operation in the target's chain
- Updates the target snapshot with the changes
Conflict Resolution
If the patch cannot be cleanly applied (e.g., entities already modified), the command will:
- Show a detailed error message
- Indicate which entities/relationships conflicted
- Suggest using
--dry-runto preview conflicts
Use Cases
- Backporting: Apply a fix from main to a release branch snapshot
- Feature reuse: Apply a feature patch across multiple project snapshots
- Testing: Verify patches work on different base states
- Disaster recovery: Reconstruct a snapshot by applying patches from another
Related Commands
apply-patch- General patch application commandpatch-info- Show patch details before cherry-pickingpatch-chain- View patch history for both source and target