# Merged git worktree

Source: https://diskcity.app/folders/git-merged-worktree

**Check before deleting.** Usually, but look first. Its commits are already in the main branch; git worktree add makes it again, and its build output rebuilds.

## What it is

A linked worktree is a second checkout of a repository. When git says its HEAD is already in the main branch, it has no changes, no untracked files and no files git is set to skip, and the only files git ignores in it are build output, everything in it is in the repository or rebuilds.

git removes it its own way (git worktree remove, never --force), so its commits stay, and its branch if it has one. DiskCity asks git again right before, and Autopilot never removes one unasked. A locked worktree, the main checkout, one with submodules or an operation under way, or one whose repository settings could start a command (filters, includes, fsmonitor) stays.

## Where it is

Usually a second checkout of a repository, made with `git worktree add`. DiskCity recognises it by what's inside, wherever it is.

## How to remove it

1. Only when its branch is already merged into the main branch, and `git status` inside it shows nothing to commit and no untracked files.
2. Leave anything opened or changed less than 1 day ago (for a folder, its newest file counts). DiskCity waits that long too.
3. Use the tool's own command, which knows what's still in use: `git worktree remove <path>`

## What DiskCity does with it

DiskCity removes it with the tool's own command, only when you approve. It only suggests it once it hasn't been used for 1 day.

## Sources

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

Checked 2026-10-28.
