Syntax
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:Examples
List all worktrees
Using the short alias
Behavior
- Repository Detection - Verifies you’re in a git repository
- Registry Lookup - Reads worktree records from
~/.gwtree/worktrees.json - Filtering - Shows only worktrees for the current repo (matched by repo name)
- Validation - Only displays worktrees whose paths still exist on disk
- Count - Shows total number of worktrees found
When No Worktrees Exist
If no worktrees are found for the current repository:Comparison with git worktree list
GWTree’slist command differs from git worktree list:
| Feature | gwt list | git worktree list |
|---|---|---|
| Shows main repo | No | Yes |
| Filtered by repo | Yes | Shows all worktrees |
| Pretty output | Yes | Raw output |
| Cross-repo tracking | Yes | No |
Exit Codes
0- Success (worktrees listed or none found)1- Error (not in a git repository)
Related Commands
- gwt status - Show detailed status with changes and commits
- gwt remove - Remove worktrees interactively
- gwt clean - Remove merged worktrees