worktree-status

Solid

Audit all git worktrees in the current project. Use when the user asks about worktree status, which branches are merged, which have uncommitted changes, or which worktrees can be safely cleaned up.

Code & Development 27 stars 8 forks Updated today MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
48
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# worktree-status Report the status of every git worktree for the current project, covering dirty state and merge status. ## When to use - User asks "which worktrees can I clean up?" - User asks "what's the status of my worktrees / branches?" - Before batch-cleaning worktrees, to avoid losing uncommitted work ## Procedure ### 1. Pull latest main (MANDATORY) You MUST pull latest main before any status checks. Without this, merge detection (both ancestry and content diff) will produce stale results and you may mistakenly conclude a branch is not merged. ```bash cd "$(git rev-parse --show-toplevel)" && git pull origin main ``` ### 2. Collect worktree info ```bash PROJECT_DIR="$(git rev-parse --show-toplevel)" for wt in $(git worktree list --porcelain | grep "^worktree " | sed 's/^worktree //' | grep -v "$PROJECT_DIR$"); do branch=$(git -C "$wt" branch --show-current 2>/dev/null) [ -z "$branch" ] && branch="(detached)" name=$(basename "$wt") # dirty? if [ -z "$(git -C "$wt" status --short 2>/dev/null)" ]; then dirty="clean" else dirty="DIRTY" fi # merged into origin/main? # NOTE: This project uses squash merges exclusively. `git merge-base # --is-ancestor` does NOT detect squash-merged branches. Always follow # up with a content diff (step 3) for branches that appear "not merged". if [ "$branch" != "(detached)" ]; then if git merge-base --is-ancestor "$branch" origin/main 2>/dev/null; then merged="merged" else merged...

Details

Author
Pythoughts-labs
Repository
Pythoughts-labs/pythinker-code
Created
4 months ago
Last Updated
today
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category