git worktree_error ai_generated true

fatal: 'path' is a missing but locked worktree

ID: git/worktree-locked

Also available as: JSON · Markdown
90%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

Git worktree was deleted from disk but git still tracks it as locked.

generic

Workarounds

  1. 95% success Unlock and remove: git worktree unlock <path> && git worktree prune
    git worktree unlock <path> && git worktree prune

    Sources: https://git-scm.com/docs/git-worktree

  2. 92% success Use git worktree prune to clean up stale worktree entries
    Use git worktree prune to clean up stale worktree entries

    Sources: https://git-scm.com/docs/git-worktree#Documentation/git-worktree.txt-prune

Dead Ends

Common approaches that don't work:

  1. Delete .git/worktrees manually 70% fail

    May break other valid worktrees

Error Chain

Frequently confused with: