Skip to content

gtl worktree delete

Parent command: gtl worktree.

Resolve a PR number, PR URL, or branch name to a matching local worktree and remove it. Use --dry-run to confirm the match before deleting.

Usage

bash
gtl worktree delete <pr-number|pr-url|branch> [flags]

Examples

bash
gtl worktree delete 123 --dry-run
gtl worktree delete https://github.com/org/repo/pull/123 --path
gtl worktree delete feature/my-branch --force

Full Help

text
Resolve a PR number, PR URL, or branch name to a matching local worktree and remove it. Use --dry-run to confirm the match before deleting.

Usage:
  gtl worktree delete <pr-number|pr-url|branch> [flags]

Examples:
gtl worktree delete 123 --dry-run
gtl worktree delete https://github.com/org/repo/pull/123 --path
gtl worktree delete feature/my-branch --force

Flags:
      --dry-run   Resolve and validate without removing
      --force     Force remove dirty worktree
  -h, --help      help for delete
      --path      Print the matched local worktree path
      --switch    Open a shell in the matched worktree (requires --dry-run)

Released under the MIT License.