Skip to Content
Managing Git WorktreesRepair a Damaged Worktree

Repair a Damaged Worktree

A worktree can become damaged when its folder or main repository is moved outside Git. WorktreeWise detects the broken registration, marks the worktree in red, disables actions that require a valid path, and exposes Repair in its actions menu.

Repair action for a damaged worktree

Repair the Connection

Identify the damaged worktree

Look for the red status icon in the Worktrees list. Open the worktree’s three-dot actions menu. Unavailable actions are disabled so they cannot run against a broken path.

Select Repair

Choose Repair. Point WorktreeWise to the worktree’s current directory if it was moved or renamed. WorktreeWise uses Git’s repair operation to restore the reciprocal pointers between the worktree and the main repository.

Verify the result

After repair completes, the worktree returns to its normal status. Open it or refresh the list to confirm that its branch, path, and actions are available again.

Repair or Prune?

Use Repair when the worktree directory still exists and contains work you want to keep. Use Prune Damaged Worktrees only when the directory is permanently gone and you want to remove its stale Git registration.

Do not prune a worktree merely because it was moved. Repair it first so its files and branch remain connected to the repository.

What Repair Changes

Repair updates Git’s administrative links: the worktree’s .git file and the matching record below the main repository’s .git/worktrees/ directory. It does not delete the worktree, discard file changes, rename its branch, or create a commit.