git-branches
Use when listing local and remote branches or visualizing branch status and divergence.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when listing local and remote branches or visualizing branch status and divergence.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when designing component interaction specs with visual states, transitions, and accessibility requirements. Covers state matrices, responsive behavior, ARIA compliance, and content constraints. Do not use for multi-step user journey mapping (use journey-mapping).
Use when mapping complete user journeys through multi-step flows, onboarding sequences, or feature workflows. Covers entry points, happy paths, alternate paths, error states, friction analysis, and delight opportunities. Do not use for individual component interaction specs (use interaction-design).
Use when analyzing an existing codebase for architecture, tech stack, conventions, and infrastructure. Covers project structure mapping, data model discovery, integration point cataloging, and constraint identification. Do not use for schema changes (use schema-design) or API contract definition (use api-design).
Use when designing documentation architecture for a project or team. Covers audience mapping, Diataxis framework classification, onboarding path design, format and location decisions, documentation testing, and maintenance scheduling. Do not use for recording individual architecture decisions (use adr-template) or creating versioned changelogs (use changelog-design).
Use when auditing codebase patterns or evaluating proposed changes for convention consistency. Covers file naming, component patterns, data fetching, state management, and type conventions. Do not use for test plan design or coverage targets (use testing-strategy).
Use when classifying data elements by sensitivity tier and defining per-tier handling requirements. Covers data inventory, sensitivity classification, PII flow mapping, encryption and masking specifications, and cross-boundary transfer documentation. Do not use for regulatory gap analysis (use compliance-review) or audit logging design (use audit-trail-design).
| name | git-branches |
| description | Use when listing local and remote branches or visualizing branch status and divergence. |
| triggers | ["git branches","list branches","show branches","branch status","all branches"] |
| version | 1.0.0 |
| user_invocable | true |
git fetch --prune to refresh remote tracking)--all, --merged, --no-merged, --stale accepted. Reject arbitrary strings or shell metacharacters.Show all branches with their status, tracking info, and sync state.
/git-branches # List all local branches with status
/git-branches --all # Include remote branches
/git-branches --merged # Only show merged branches
/git-branches --no-merged # Only show unmerged branches
/git-branches --stale # Show branches with deleted remotes
# Fetch to get accurate remote status
git fetch --all --prune --quiet
# List local branches with tracking info
git branch -vv
# For each branch, calculate ahead/behind
for branch in $(git branch --format='%(refname:short)'); do
upstream=$(git rev-parse --abbrev-ref "$branch@{u}" 2>/dev/null)
if [ -n "$upstream" ]; then
ahead=$(git rev-list --count "$upstream..$branch")
behind=$(git rev-list --count "$branch..$upstream")
echo "$branch: $ahead ahead, $behind behind of $upstream"
else
echo "$branch: no upstream"
fi
done
# Check if branch is merged into main
git branch --merged main
git branch --no-merged main
# Branches whose remote has been deleted
git branch -vv | grep ': gone]'
Branches (4 local, 6 remote)
* feat/dark-mode abc1234 [origin/feat/dark-mode: ahead 2]
Add theme toggle component
main def5678 [origin/main]
Latest release
feat/user-auth ghi9012 [origin/feat/user-auth: behind 3]
Add login form
fix/old-bug jkl3456 [origin: gone]
Fix deprecated (remote deleted)
Legend:
* = current branch
ahead N = local commits not pushed
behind N = remote commits not pulled
gone = remote branch deleted
Quick actions:
/git-switch <branch> # Switch to branch
/git-delete-branch <name> # Delete branch
/git-sync # Fetch updates
Branches merged into main:
fix/login-bug (merged 3 days ago)
feat/old-feature (merged 1 week ago)
chore/cleanup (merged 2 weeks ago)
These branches can be safely deleted with:
/git-delete-branch --merged
Stale branches (remote deleted):
feat/abandoned-feature [origin: gone] - Remote deleted
fix/old-bug [origin: gone] - Remote deleted
These branches have no remote tracking anymore.
Clean up with:
/git-delete-branch feat/abandoned-feature
/git-delete-branch --stale # Delete all stale
Local branches:
* feat/dark-mode abc1234 [ahead 2]
main def5678 [up to date]
Remote branches (origin):
origin/main
origin/feat/dark-mode
origin/feat/user-auth
origin/feat/api-v2
origin/HEAD -> origin/main
Remote branches not checked out locally:
origin/feat/api-v2 # /git-switch feat/api-v2 to check out
| Symbol | Meaning |
|---|---|
* | Current branch |
ahead N | N commits to push |
behind N | N commits to pull |
gone | Remote branch deleted |
[up to date] | Synced with remote |
[no upstream] | No remote tracking |
At the end of output, show summary:
Summary:
Current: feat/dark-mode
Total: 4 local, 6 remote
Ahead: 1 branch needs push
Behind: 1 branch needs pull
Stale: 2 branches (remote deleted)
Merged: 3 branches can be deleted
/git-switch <branch> to change branches/git-delete-branch to clean up branches/git-sync to update remote information/git-pull to sync branches that are behind