Skip to main content
GWTree provides powerful commands to manage your worktrees throughout their lifecycle.

List Worktrees

View all worktrees for the current repository:

List Output

The list shows:
  • 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

Indicators:
  • Green color
  • Shows “ready to merge (N commits ahead)”
  • No uncommitted changes
  • Commits exist ahead of main
Example:
Actions:
  • Ready for code review
  • Can be merged with gwt merge feature-auth
  • Can be cleaned up with gwt clean after merging

Status Summary

The bottom line shows aggregated counts:
Helps you quickly understand:
  • 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 Multiple Worktrees

The remove command continues in a loop, allowing you to remove multiple worktrees without restarting:
  1. Select and remove first worktree
  2. List automatically refreshes
  3. Select and remove next worktree
  4. Repeat until done
  5. 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
If 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:
  1. Detect the current repository
  2. Filter worktrees to show only those for the current repo
  3. Verify worktree directories still exist
This means:
  • You can have worktrees for multiple repos
  • Each repo only sees its own worktrees
  • Deleted directories are automatically excluded

Examples

Check What Needs Attention

Review the status to see:
  • Which worktrees are ready to merge
  • Which worktrees have uncommitted work
  • Which worktrees can be cleaned up

List All Worktrees

Simple list of branches and paths.

Remove Old Worktrees

Clean Up After Work

Comparison Table

Next Steps