How to fix fatal: 'feature' is already checked out at '/path/to/worktree' in Git

GitINTERMEDIATELOWUpdated Apr 28, 2026ยท 573 views

This error occurs when Git prevents checking out a branch that's already in use by another worktree. Learn how to prune stale worktrees, use the --force flag, or work with detached HEAD.

Quick fix

Fixes fatal: 'feature' is already checked out at '/path/to/worktree'

git worktree list
  1. List all existing worktrees
  2. Prune stale worktree references
  3. Properly remove the conflicting worktree
  4. Use --force to override the restriction
git โ€” error
git worktree list
fatal: 'feature' is already checked out at '/path/to/worktree'

What this error means

When you see the error "fatal: '<branch>' is already checked out at '<path>'", Git is preventing you from checking out a branch that is already active in another worktree. This is an intentional safety mechanism, not a bug. Git worktrees allow you to have multiple working directories attached to the same repository, each with its own checked-out branch. However, Git enforces a rule that the same branch cannot be checked out in more than one worktree simultaneously. If it allowed this, making a commit in one worktree would put the other worktree in a confusing state - its branch reference would have moved without any changes to its working directory or index. In Git 2.43 and later, the error message was updated to say "is already used by worktree at" instead of "is already checked out at". This newer message also covers cases where a branch is being rebased or bisected, not just checked out. Regardless of the exact wording, the solution approaches remain the same.

Typical symptoms

  • Git refuses to checkout a branch with 'fatal: is already checked out at' error
  • Cannot create a new worktree for a branch that exists in another worktree
  • Error persists even after manually deleting a worktree directory
  • Git worktree list shows worktrees that no longer exist on disk
  • Error mentions 'is already used by worktree at' (Git 2.43+)

Common causes

  1. The branch is legitimately checked out in another existing worktree
  2. A worktree directory was manually deleted without using 'git worktree remove'
  3. A worktree has the branch in a rebase or bisect operation, even if not checked out
  4. Stale worktree references remain in .git/worktrees/ after improper cleanup
  5. Attempting to add a new worktree for the same branch as an existing worktree
  6. Worktree was moved or renamed without updating Git's tracking

How to fix "fatal: 'feature' is already checked out at '/path/to/worktree'"

1List all existing worktrees

First, see what worktrees Git knows about and which branches they have checked out:

bash
git worktree list

This will show output like:

bash
/home/user/project        abc1234 [main]
/home/user/project-feature def5678 [feature]

Check if the branch mentioned in the error is actually in use by one of these worktrees, or if the listed path no longer exists on disk.

2Prune stale worktree references

If a worktree directory was deleted manually (not using git worktree remove), Git still thinks it exists. Prune these stale references:

bash
# See what would be pruned without actually doing it
git worktree prune --dry-run

# Actually prune stale worktree information
git worktree prune

After pruning, try your checkout or worktree add command again. This fixes the error in most cases where the worktree was manually deleted.

3Properly remove the conflicting worktree

If the worktree still exists and you no longer need it, remove it properly:

bash
# Remove the worktree (safer than manual deletion)
git worktree remove /path/to/worktree

# Force remove if there are untracked files or modifications
git worktree remove --force /path/to/worktree

This removes both the directory and Git's internal reference to the worktree.

4Use --force to override the restriction

If you intentionally want the same branch checked out in multiple worktrees (understanding the risks), use the --force flag:

bash
# Force checkout even if branch is used elsewhere
git worktree add --force /path/to/new/worktree feature

# Force also works with git checkout in some scenarios
git checkout --force feature

Warning: Having the same branch in multiple worktrees can cause confusion. If you commit in one worktree, the other will have an outdated branch reference and may show unexpected behavior.

5Use a detached HEAD instead

If you just need to view or test code at the same commit as the branch, use a detached HEAD:

bash
# Create worktree with detached HEAD at the same commit
git worktree add --detach /path/to/new/worktree feature

# Or checkout in detached HEAD mode
git checkout --detach feature

With detached HEAD, you're at the same commit but not on the branch, so there's no conflict. Any commits you make will need to be explicitly saved to a branch.

6Create a new branch at the same commit

Create a new branch pointing to the same commit as the one you can't check out:

bash
# Create a new branch at the same point as 'feature'
git worktree add -b feature-worktree2 /path/to/new/worktree feature

This creates a new worktree with a branch called feature-worktree2 that starts at the same commit as feature. You can work independently and merge or cherry-pick changes later.

7Check for stuck rebase or bisect operations

In Git 2.43+, a branch can be "in use" if it's in the middle of a rebase or bisect in another worktree:

bash
# Check for rebase or bisect state in worktrees
ls .git/worktrees/*/rebase-merge 2>/dev/null
ls .git/worktrees/*/BISECT_LOG 2>/dev/null

If found, go to that worktree and complete or abort the operation:

bash
# Abort rebase in the other worktree
git -C /path/to/other/worktree rebase --abort

# Or abort bisect
git -C /path/to/other/worktree bisect reset
8Manually clean worktree metadata (last resort)

If nothing else works, you can manually remove Git's worktree tracking data:

bash
# List worktree metadata directories
ls .git/worktrees/

# Remove the stale worktree reference (be careful!)
rm -rf .git/worktrees/worktree-name

Warning: Only do this if you're certain the worktree no longer exists on disk. This directly modifies Git's internal state.

Advanced notes

### Why Git Enforces This Restriction

The one-branch-per-worktree rule exists because each worktree has its own HEAD file but shares the same refs (branches and tags) with all other worktrees. If two worktrees had the same branch checked out and you made a commit in one, the branch ref would advance, but the other worktree's index and working directory wouldn't update. That worktree would appear to be "behind" its own branch with no obvious reason - a confusing and error-prone situation.

### Worktree Locking

Git supports locking worktrees to prevent accidental removal:

bash
# Lock a worktree (e.g., when on removable media)
git worktree lock /path/to/worktree --reason "On USB drive"

# Unlock when accessible again
git worktree unlock /path/to/worktree

When a worktree is locked, git worktree prune won't remove it even if the path is inaccessible. Use --force --force with git worktree add to override a locked worktree.

### Automatic Pruning

Git automatically prunes stale worktree data during garbage collection based on gc.worktreePruneExpire (default: 3 months). You can trigger this manually:

bash
git gc

### Worktrees and Bare Repositories

Worktrees are especially useful with bare repositories (common on servers):

bash
# In a bare repo, create a worktree to make changes
git worktree add ../working-copy main

This pattern is useful for CI/CD systems that need to build different branches concurrently from the same repository clone.

Frequently asked questions

What does "fatal: 'feature' is already checked out at '/path/to/worktree'" mean?
When you see the error "fatal: '<branch>' is already checked out at '<path>'", Git is preventing you from checking out a branch that is already active in another worktree. This is an intentional safety mechanism, not a bug. Git worktrees allow you to have multiple working directories attached to the same repository, each with its own checked-out branch.
How do I fix "fatal: 'feature' is already checked out at '/path/to/worktree'"?
This error occurs when Git prevents checking out a branch that's already in use by another worktree. Learn how to prune stale worktrees, use the --force flag, or work with detached HEAD.
What causes "fatal: 'feature' is already checked out at '/path/to/worktree'"?
The branch is legitimately checked out in another existing worktree A worktree directory was manually deleted without using 'git worktree remove' A worktree has the branch in a rebase or bisect operation, even if not checked out
Is the "fatal: 'feature' is already checked out at '/path/to/worktree'" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading