Move a registered in-repo vault to branch mode, where it lives on its own orphan branch and
syncs without a checkout, without losing an event.
For a vault set up by hand in a linked worktree on a dedicated branch, migrate adopts that branch
and vault path, copies the worktree's vault files (committed or not) into the local mirror, switches
the registry entry to branch mode keeping its name, identity, options and anti-rollback state,
syncs once, and then offers to remove the worktree (git worktree remove, never forced) and to
delete the local branch (only when its tip is on the remote). --remove-worktree answers yes to
both. A worktree whose branch also holds other root files is refused: commit their removal on
that branch in the worktree and run migrate again.
For a vault committed on the code branch, migrate copies it into the mirror, creates the vault
branch (--branch, default vaultfold) on the remote, records the branch in vault.toml and prints the
steps that remove the vault directory from the code branch through your normal pull request flow.
Until that directory is gone, sync also imports vault files found there that the mirror lacks.
The vault defaults to the one the working directory selects. migrate is refused in an agent
vaultfold vault migrate [<name>] [flags]
--branch b for a vault committed on the code branch, the vault branch b to create (default vaultfold)
-h, --help help for migrate
--remove-worktree for a manual worktree vault, remove the worktree and its fully pushed branch without asking
--json print exactly one JSON document on stdout
--vault name select a vault from the registry by name