docs(remove): state that --force discards all uncommitted changes#2869
Merged
Conversation
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
approved these changes
May 21, 2026
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
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_commandinsrc/commands/process.rs—///force_worktreeadds--forcetogit worktree remove, allowing removal /// even when the worktree contains untracked files (like build artifacts).force_worktreefield on theRemovevariant insrc/commands/worktree/types.rs—/// Force git worktree removal even with untracked files.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The FAQ and the
wt remove --forcehelp text said--forceoverrides the untracked-files check "for build artifacts".--forceactually 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
--forcearg help, the "Force flags" table and example insrc/cli/mod.rs, and the FAQ to say--forcediscards staged, modified, and untracked files; thehelp_remove_longsnapshot and theremove.md/faq.mddoc and skill mirrors are regenerated to match.