Skip to main content

Syntax

gwt list
gwt ls

Description

Lists all worktrees associated with the current repository. Shows the branch name and full path for each worktree. This command reads from GWTree’s internal worktree registry (~/.gwtree/worktrees.json) and filters results to only show worktrees for the current repository.

Aliases

  • ls - Short alias for list

Output Format

The output displays each worktree with its branch name and path:
┌  Worktrees for myapp

│  ◆  feature-auth
│  └  /Users/john/projects/myapp-feature-auth

│  ◆  feature-payment
│  └  /Users/john/projects/myapp-payment

│  ◆  bugfix-404
│  └  /Users/john/projects/myapp-bugfix-404

└  3 worktrees

Examples

List all worktrees

gwt list

Using the short alias

gwt ls

Behavior

  1. Repository Detection - Verifies you’re in a git repository
  2. Registry Lookup - Reads worktree records from ~/.gwtree/worktrees.json
  3. Filtering - Shows only worktrees for the current repo (matched by repo name)
  4. Validation - Only displays worktrees whose paths still exist on disk
  5. Count - Shows total number of worktrees found

When No Worktrees Exist

If no worktrees are found for the current repository:
gwt list
Output:
No worktrees found for this repo

Comparison with git worktree list

GWTree’s list command differs from git worktree list:
Featuregwt listgit worktree list
Shows main repoNoYes
Filtered by repoYesShows all worktrees
Pretty outputYesRaw output
Cross-repo trackingYesNo

Exit Codes

  • 0 - Success (worktrees listed or none found)
  • 1 - Error (not in a git repository)