feat: add git-worktree-branch-delete command#211
Merged
Conversation
Design document for issue #166: a command that fully deletes a branch including its worktree, local branch, and remote tracking branch with safety checks modeled after git branch -d. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8-task plan covering: git method additions, command scaffolding, validation phase, execution phase, integration tests, man/CLI docs, docs site updates, and final verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add merge_base_is_ancestor, cherry, push_delete, has_uncommitted_changes_in, and rev_parse methods to GitCommand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add command module, routing, shortcut (gwtbd), help docs registration, xtask integration, and suggest support. Implementation is a placeholder. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add safety checks: branch exists, not default branch, no uncommitted changes, merged into default (with squash detection), local/remote in sync. Validate-then-execute ensures no partial state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delete remote branch, remove worktree, delete local branch with hooks and cleanup. Current worktree deferred to last with CD target resolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover basic delete, unmerged refusal, force override, default branch protection, dirty worktree refusal, multiple branches, no-worktree branch, and nonexistent branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
avihut
commented
Feb 16, 2026
Remove the --no-cd flag from branch-delete: when deleting the current worktree the CD is mandatory (nowhere to stay), and for other branches it's irrelevant. Also remove design and plan documents that are development artifacts, not permanent documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 16, 2026
Merged
Merged
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.
Summary
git-worktree-branch-delete(gwtbd) command that fully deletes a branch: its worktree, local branch, and remote tracking branch as a single atomic-feeling operation--force/-D)git cherry), local/remote in sync--quiet/--verboseflags, and current-worktree deferral with CD target resolutionFixes #166
Test Plan
🤖 Generated with Claude Code