用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-git-github --skill branching命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | branching |
| description | Git branching strategies - create, switch, merge, rebase, and workflows |
| sasmp_version | 1.3.0 |
| bonded_agent | git-expert |
| bond_type | PRIMARY_BOND |
| category | development |
| version | 2.0.0 |
| triggers | ["git branch","git merge","git rebase","branching strategy"] |
Production-Grade Development Skill | Version 2.0.0
Effective branching and merging strategies for development workflows.
input:
type: object
properties:
operation:
type: string
enum: [create, switch, merge, rebase, delete, list, strategy]
default: list
branch_name:
type: string
pattern: "^[a-zA-Z0-9/_-]+$"
maxLength: 100
strategy:
type: string
enum: [gitflow, github-flow, trunk-based]
options:
type: object
properties:
force:
type: boolean
default: false
dry_run:
type: boolean
default: false
output:
type: object
required: [result, success]
properties:
result:
type: string
success:
type: boolean
branches_affected:
type: array
items:
type: string
warnings:
type: array
rollback_command:
type: string
retry_config:
max_attempts: 2
backoff_ms: [1000, 2000]
retryable:
- lock_file_exists
- network_timeout
non_retryable:
- merge_conflict
- branch_not_found
fallback:
- trigger: merge_conflict
action: abort_and_guide_manual_resolution
command: git merge --abort
- trigger: rebase_conflict
action: abort_and_suggest_merge
command: git rebase --abort
# List branches
git branch # Local branches
git branch -r # Remote branches
git branch -a # All branches
# Create branch
git branch feature-x # Create only
git checkout -b feature-x # Create and switch
git switch -c feature-x # Modern syntax
# Switch branches
git checkout main
git switch main # Modern syntax
# Delete branch
git branch -d feature-x # Safe delete
git branch -D feature-x # Force delete
git push origin --delete feature-x # Delete remote
┌─────────────────────────────────────────────────────────────┐
│ GITFLOW │
├─────────────────────────────────────────────────────────────┤
│ main ●─────────────────●───────────────●──────────► │
│ ↑ ↑ ↑ │
│ release ├─────●───────────┤ │ │
│ │ ↑ │ │ │
│ develop ├──●──┴──●──●──●──┴──●──●──●──●──┴──●──●──────► │
│ │ ↑ ↑ ↑ ↑ ↑ │
│ feature └──┴─────┴─────┴─────┴─────┘ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ GITHUB FLOW │
├─────────────────────────────────────────────────────────────┤
│ main ●────────●────────●────────●────────●─────────► │
│ \ ↑ \ ↑ \ ↑ │
│ feature \────● \───● \───● │
│ (PR) (PR) (PR) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ TRUNK-BASED DEV │
├─────────────────────────────────────────────────────────────┤
│ main ●──●──●──●──●──●──●──●──●──●──●──●──●─────────► │
│ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ │
│ (frequent small commits to main) │
└─────────────────────────────────────────────────────────────┘
| Strategy | Command | Use Case |
|---|---|---|
| Fast-Forward | git merge feature | Linear history |
| Three-Way | git merge feature | Diverged branches |
| Squash | git merge --squash feature | Clean history |
| Aspect | Merge | Rebase |
|---|---|---|
| History | Preserves | Linear |
| Safety | Shared branches OK | Never on shared |
| Conflicts | Resolve once | May resolve multiple |
□ 1. Current branch? → git branch
□ 2. Uncommitted changes? → git status
□ 3. Diverged? → git log --oneline main..HEAD
| Error | Cause | Solution |
|---|---|---|
| "already exists" | Branch name taken | Use different name |
| "not fully merged" | Unmerged commits | Use -D or merge first |
| "CONFLICT" | Divergent changes | Resolve manually |
logging:
level: INFO
events:
- branch_created
- merge_completed
- conflict_detected
metrics:
- branches_per_repo
- merge_conflict_rate
feature/user-auth, fix/login-bug"Branches are cheap in Git - use them liberally."