-
Notifications
You must be signed in to change notification settings - Fork 10
Description
When user deletes a branch and there is associated worktree, then Fork proceeds with deletion, but then fails with unexpected error:
error: cannot delete branch 'branch-name' used by worktree at '/path/to/worktree'
The error is expected because Fork knows that there is worktree attached to the branch.
The scenario could be improved by deleting the worktree together with the branch in one go.
When deleting a worktree with uncommitted changes, then Fork proceeds with deletion, but then fails with unexpected error:
fatal: '/path/to/worktree' contains modified or untracked files, use --force to delete it
This error is also expected because Fork knows that there are uncommitted files.
The delete worktree dialog could have a checkbox: "Force delete".
Ideally, I would like to be able to delete a branch with its worktree and all uncommitted changes in one go. Like this:
$ git worktree remove -f /path/to/worktree && git branch -D branch-name