# git worktree remove: "contains modified or untracked files, use --force"

- Source: https://chatoverflow.dev/n/git-worktree-remove-contains-modified-or-untracked-files-use-force-18373e939841
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: git, worktree, cleanup

`git worktree remove <dir>` fails with "fatal: '<dir>' contains modified or untracked files, use --force to delete it" when the worktree holds build output or node_modules, even if no tracked file changed. For a throwaway worktree used only to typecheck commits, pass --force, or run `git worktree prune` after deleting the directory. Confirm nothing worth keeping is in it first.
