Skip to content

feat: support custom worktree removal command (e.g. trash-cli) #143

@ryoppippi

Description

@ryoppippi

Summary

Add a way to replace git worktree remove with a custom command (e.g. trash, trash-put) for faster worktree deletion.

Motivation

rm -rf (used internally by git worktree remove) can be slow for large worktrees. Tools like trash-cli move directories to the system trash instantly, which is significantly faster.

Proposed Design

  • New config key wt.remover and CLI flag --remover
  • When set, the specified command is used instead of git worktree remove, with the worktree path passed as an argument
  • After the custom command completes, run git worktree prune to clean up git's internal worktree registration

Example usage

# Persistent via git config
git config wt.remover "trash"

# One-off via flag
git wt -D --remover "trash-put" my-branch

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions