Skip to content

docs(remove): state that --force discards all uncommitted changes#2869

Merged
max-sixty merged 1 commit into
mainfrom
remove-force-docs
May 22, 2026
Merged

docs(remove): state that --force discards all uncommitted changes#2869
max-sixty merged 1 commit into
mainfrom
remove-force-docs

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The FAQ and the wt remove --force help text said --force overrides the untracked-files check "for build artifacts". --force actually removes a dirty worktree including staged and modified tracked files, not just untracked ones (test_remove_force_with_modified_files, test_remove_force_with_staged_files). On a destructive command, that wording can lead users to consent to more data loss than they expected.

Updates the --force arg help, the "Force flags" table and example in src/cli/mod.rs, and the FAQ to say --force discards staged, modified, and untracked files; the help_remove_long snapshot and the remove.md / faq.md doc and skill mirrors are regenerated to match.

This was written by Claude Code on behalf of Maximilian Roos

The FAQ and the `wt remove --force` help text said --force overrides the
untracked-files check "for build artifacts". --force actually removes a
dirty worktree including staged and modified tracked files, not just
untracked ones (test_remove_force_with_modified_files,
test_remove_force_with_staged_files). On a destructive command, that
wording can lead users to consent to more data loss than they expected.

Update the --force arg help, the "Force flags" table and example in
src/cli/mod.rs, and the FAQ to say --force discards staged, modified, and
untracked files; refresh the help_remove_long snapshot to match. Doc and
skill mirrors (remove.md, faq.md) regenerated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User-facing wording is accurate — verified against test_remove_force_with_modified_files and test_remove_force_with_staged_files, and against build_remove_command which forwards --force straight to git worktree remove --force.

Two internal doc comments still carry the pre-correction framing if you want to mop them up while the context is fresh — both purely developer-facing, so happy to push a follow-up if useful:

  • build_remove_command in src/commands/process.rs/// force_worktreeadds--forcetogit worktree remove, allowing removal /// even when the worktree contains untracked files (like build artifacts).
  • force_worktree field on the Remove variant in src/commands/worktree/types.rs/// Force git worktree removal even with untracked files.

@max-sixty max-sixty merged commit 89ec4f7 into main May 22, 2026
36 checks passed
@max-sixty max-sixty deleted the remove-force-docs branch May 22, 2026 01:40
max-sixty added a commit that referenced this pull request May 23, 2026
)

The FAQ and the `wt remove --force` help text said `--force` overrides
the untracked-files check "for build artifacts". `--force` actually
removes a dirty worktree including staged and modified *tracked* files,
not just untracked ones (`test_remove_force_with_modified_files`,
`test_remove_force_with_staged_files`). On a destructive command, that
wording can lead users to consent to more data loss than they expected.

Updates the `--force` arg help, the "Force flags" table and example in
`src/cli/mod.rs`, and the FAQ to say `--force` discards staged,
modified, and untracked files; the `help_remove_long` snapshot and the
`remove.md` / `faq.md` doc and skill mirrors are regenerated to match.

> _This was written by Claude Code on behalf of Maximilian Roos_

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants