🧹

自動でgit worktree prune

に公開
.zshrc
git() {
    if [[ "$1" == worktree* || "$1" == wt* ]]; then
        command git worktree prune 2>/dev/null
    fi
    command git "$@"
}

こういう alias を想定して前方 glob してる。

.gitconfig
[alias]
  worktrees = worktree list
  wta = worktree add

Discussion