{"version":"2.1.302","anchor":"git-worktree-detection-treats-a-broken-gitfile-as-not-a-repo","canonical_anchor":"git-worktree-detection-treats-a-broken-gitfile-as-not-a-repo","heading":"Broken git worktree links are treated as \"not a git repository\"","tier":"notice","area":"Git","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.302\/e\/git-worktree-detection-treats-a-broken-gitfile-as-not-a-repo","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.302","markdown":"### Broken git worktree links are treated as \"not a git repository\"\n\nClaude Code now treats a worktree whose link points nowhere valid as not a git repository, and reads the branch from the right place\n\n**What**\n\nA git worktree is an extra working folder linked to an existing repository through a small `.git` file that points back to it. When that link points to something that is no longer a valid repository, git reports \"gitfile does not point to a valid repository\". Claude Code now treats that the same as \"not a git repository\".\n\nWorking out which branch is checked out now also reads the right data: the contents of the file, instead of the file's details.\n\n**Why**\n\nLeft-over worktrees whose repository has moved or been removed now fail quietly instead of causing errors.\n\n- Area: Git\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}