List Worktrees
View all worktrees for the current repository:List Output
- Branch name: The git branch for the worktree
- Path: Full filesystem path to the worktree directory
- Count: Total number of worktrees
Empty List
If no worktrees exist for the repo:View Status
Get detailed status information for all worktrees:Status Output
Status Information
For each worktree, the status command shows:Change Statistics
- Additions: Lines added (
+245) - Deletions: Lines removed (
-12) - Calculated from
git diff --stat HEAD
Commit Position
- Ahead: Commits ahead of main
- Behind: Commits behind main
- Calculated from
git rev-list --left-right --count main...branch
Work Status
- Changed files: Uncommitted modifications
- Calculated from
git status --porcelain
Merge Status
- ✓ merged: Branch has been merged to main
- ready to merge: No uncommitted changes, commits ahead
- in progress: Has uncommitted changes or needs sync
Status Categories
- Ready to Merge
- In Progress
- Merged
Indicators:Actions:
- Green color
- Shows “ready to merge (N commits ahead)”
- No uncommitted changes
- Commits exist ahead of main
- Ready for code review
- Can be merged with
gwt merge feature-auth - Can be cleaned up with
gwt cleanafter merging
Status Summary
The bottom line shows aggregated counts:- How many worktrees are ready for review/merge
- How many are actively being worked on
- How many can be cleaned up
Remove Worktrees
Interactively remove worktrees:Remove Workflow
┌ Remove Worktree
│
◆ Search worktree:
│ feature-auth myrepo-feature-auth
│ feature-api myrepo-feature-api
│ bug-fix myrepo-bug-fix
git worktree remove "{path}" --forceRemove Multiple Worktrees
The remove command continues in a loop, allowing you to remove multiple worktrees without restarting:- Select and remove first worktree
- List automatically refreshes
- Select and remove next worktree
- Repeat until done
- Cancel to exit
Force Removal
The--force flag ensures removal even if:
- The worktree has uncommitted changes
- The worktree has unpushed commits
- The git repository is in an inconsistent state
git worktree remove fails, GWTree falls back to rm -rf to delete the directory.
Worktree Tracking
GWTree maintains a global database of worktrees at:Tracked Information
For each worktree:Per-Repository Filtering
All commands (list, status, rm) automatically:
- Detect the current repository
- Filter worktrees to show only those for the current repo
- Verify worktree directories still exist
- You can have worktrees for multiple repos
- Each repo only sees its own worktrees
- Deleted directories are automatically excluded
Examples
Check What Needs Attention
- Which worktrees are ready to merge
- Which worktrees have uncommitted work
- Which worktrees can be cleaned up
List All Worktrees
Remove Old Worktrees
Clean Up After Work
Comparison Table
| Command | Purpose | Output | Interactive |
|---|---|---|---|
gwt ls | List worktrees | Branch + path | No |
gwt status | Detailed status | Changes, commits, merge state | No |
gwt rm | Remove worktrees | Confirmation prompts | Yes |
Next Steps
- Learn about merging and cleanup for completing work
- Explore configuration to customize behavior
- Return to creating worktrees for starting new work