git worktree prune: Clean Up Stale Git Worktrees
The git worktree prune command cleans up stale administrative records in .git/worktrees/ whose working directories have been manually deleted from disk.
git worktree remove vs git worktree prune
A common point of confusion among developers is the difference between remove and prune:
git worktree remove
Deletes the actual working directory folder from your hard drive AND unregisters its administrative record in .git/worktrees/.
git worktree prune
Cleans up orphaned administrative metadata when a folder was deleted manually via rm -rf, Finder, or Explorer.
How Stale Metadata Happens
When you create a worktree, Git registers an entry in .git/worktrees/<name>/. If you later delete that worktree folder using rm -rf, macOS Finder, or Windows Explorer instead of using git worktree remove, Git still thinks the worktree exists.
As a result, you might encounter errors like:
fatal: 'feature/auth' is already checked out at '/path/to/old/deleted-folder'
Running git worktree prune immediately scans your filesystem, finds which registered paths no longer exist, and cleans up their obsolete administrative files.
Command Usage & Safe Dry Run
1. Preview changes with dry-run
Always run a dry run first to see what stale records would be pruned:
Removing worktrees/project-old-feature: gitdir file points to non-existent location
2. Execute pruning
3. Prune by expiration time
You can specify an expiration window so that recently disconnected paths (e.g. from removable drives) are not immediately discarded:
Prune Stale Worktrees
WorktreeWise automatically detects missing or stale worktree folders in real-time, displaying a quick 1-click 'Prune Stale Records' button that keeps your Git repository clean and free of ghost branch checkouts.

Related commands
If a worktree folder was moved instead of deleted, do not prune it! Instead, restore the connection using git worktree repair.