📣
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: Require the base workspace to use blobless Git storage.
  • --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 file system user token. If omitted, uses TI_FS_TOKEN.
  • --help: Display help information.
  • --hydrate <string>: Blobless hydrate mode: auto, background, sync, or off. [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?