用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill git-branches命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | git-branches |
| description | List and visualize branch status Use when this capability is needed. |
| metadata | {"author":"dtsong"} |
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 behindConverted and distributed by TomeVault — claim your Tome and manage your conversions.