📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ti fs-git add-git-worktree



Adds a linked Git worktree from a base workspace.

Syntax

ti fs-git add-git-worktree --base-path <string> --worktree-path <string> [--blobless] [--branch-name <string>] [--commit-ish <string>] [--detach] [--dry-run] [--file-system-id <string>] [--fs-token <string>] [--help] [--hydrate <string>] [--version]

Options

  • --base-path <string>: The mounted file system path of the base Git workspace. [required]
  • --worktree-path <string>: The mounted file system path for the linked worktree. [required]
  • --blobless: Verify that the base workspace uses blobless Git storage. This option does not convert a non-blobless workspace.
  • --branch-name <string>: Create a branch for the linked worktree.
  • --commit-ish <string>: Optional commit-ish for the linked worktree.
  • --detach: Create a detached linked worktree.
  • --dry-run: Validate the request without applying changes.
  • --file-system-id <string>: Select the file system. You can also set TI_FS_FILE_SYSTEM_ID.
  • --fs-token <string>: Set the Filesystem token. If omitted, the command uses the TI_FS_TOKEN environment variable. If neither is provided, the command uses the local token stored for the selected Filesystem.
  • --help: Display help information.
  • --hydrate <string>: Clean-data hydration mode: auto, background, sync, or off. With auto, a worktree linked to a blobless base hydrates in the background, while a worktree linked to a non-blobless base does not run a separate hydration step. background and sync require a blobless base; off skips hydration. [default: auto]
  • --version: Display version information.

For options shared by all commands, see Global options.

Examples

  • Create a worktree on a new branch:

    # Give an agent an isolated branch while sharing the base Git object store. ti fs-git add-git-worktree --file-system-id <file-system-id> --base-path /path/to/workspace/tidb --worktree-path /path/to/workspace/tidb-feature --branch-name feature-x
  • Create a detached worktree:

    # Inspect a commit without creating or switching a branch. ti fs-git add-git-worktree --file-system-id <file-system-id> --base-path /path/to/workspace/tidb --worktree-path /path/to/workspace/tidb-review --commit-ish origin/main --detach

Was this page helpful?