Skip to content

Add worktree prune to clean-branches command #1164

@dyoshikawa

Description

@dyoshikawa

Summary

Add git worktree prune execution to the clean-branches command.

Motivation / Purpose

When working with git worktrees (e.g., via git gtr), stale worktree references can accumulate over time. The clean-branches command already handles branch cleanup and remote pruning, so it's a natural place to also prune stale worktree entries.

Details

Modify .rulesync/commands/clean-branches.md to include a git worktree prune step.

Current steps:

  1. Delete all local branches except for current branch and main branch.
  2. Run git pull --prune

Proposed steps:

  1. Delete all local branches except for current branch and main branch.
  2. Run git pull --prune
  3. Run git worktree prune

Files affected

  • .rulesync/commands/clean-branches.md

Additional Context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer-scrapRough notes for AI implementation. Not for human eyes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions