Skip to content

Feature: bd migrate sync --clean to create minimal orphan branch #1125

@akkaneror

Description

@akkaneror

Problem

When running bd migrate sync <branch-name>, the sync branch is created from the current HEAD, which includes the entire codebase. This results in:

  • Wasted space: ~50MB+ of stale source code sitting in the sync branch
  • Confusion: The branch looks like a code branch but only .beads/ is ever updated
  • Inconsistency with similar patterns: gh-pages branches typically only contain build output, not source code

Example after running bd migrate sync beads-sync:

beads-sync branch contains:
├── .beads/          ← only this gets updated
├── apps/            ← stale, never updated
├── packages/        ← stale, never updated
├── src/             ← stale, never updated
└── ... 60+ other dirs/files (all stale)

Proposed Solution

Add a --clean or --orphan flag to create a minimal sync branch:

bd migrate sync beads-sync --clean

This would:

  1. Create an orphan branch (no parent commits)
  2. Only include .beads/ directory
  3. Result in a clean, minimal sync branch

Alternative

Automatically use the orphan approach by default (with --full flag to preserve current behavior if needed).

Environment

  • bd version: 0.47.1
  • OS: macOS (Darwin)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions