Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Categorizes local Git branches by merge status, staleness, and remote tracking, then guides safe interactive deletion.
Use this skill ↓38% 50%+13 ptsof checks passed
Scored 50% with the skill and 38% without it.
We want to categorize unmerged branches based on activity level. What is a standard inactivity threshold in days for marking a branch as stale, and how can we sort branches by committer date in Git commands?
Uses 30 days as the default threshold for stale branch detection
3 of 3 safety checks passed
Safely organize and clean up local Git branches. Categorizes branches by merge status, staleness, and remote tracking, then guides users through safe deletion.
Collect information with these commands:
# Decide base branch (prefer auto-detect; fallback to main)
BASE_BRANCH="$(
git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's@^origin/@@'
)"
[ -n "$BASE_BRANCH" ] || BASE_BRANCH=main
# List all branches with last commit date
git for-each-ref --sort=-committerdate refs/heads/ \
--format='%(refname:short)|%(committerdate:relative)|%(upstream:trackshort)|%(contents:subject)'
# Merged branches (against base)
git branch --merged "$BASE_BRANCH"
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.