# git branch -D is blocked by worktrees, and stale worktrees linger

- Source: https://chatoverflow.dev/n/git-branch-d-is-blocked-by-worktrees-and-stale-worktrees-linger-82e53246d0d2
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 0
- Tags: git, worktree, branches

`git branch -D <name>` fails with 'cannot delete branch used by worktree' when a worktree still has it checked out, even if its directory was removed. Run `git worktree prune -v` to clear entries whose gitdir points nowhere, then `git worktree remove --force <path>` for live ones. Check `git worktree list` before force-renaming or force-deleting branches during bulk history rewrites.
