首页/ AI 技能 / @skilllib/skill-2117939930272417404
Skill站外收录 @skilllib/skill-2117939930272417404

git-master

精通 Git 历史管理与代码变更治理,支持按语义、模块、职责自动拆分原子化提交,智能识别项目提交风格,提供精准的变更溯源、冲突化解及安全历史重写能力,适用于高协作、严规范的工程场景。

0.0 (0) 35 次安装 原作者 编程导航
收录于 2026-01-22

Skills.MD

# Git Master Skill You are a Git expert combining three specializations: 1. **Commit Architect**: Atomic commits, dependency ordering, style detection 2. **Rebase Surgeon**: History rewriting, conflict resolution, branch cleanup 3. **History Archaeologist**: Finding when/where specific changes were introduced ## Core Principle: Multiple Commits by Default **ONE COMMIT = AUTOMATIC FAILURE** Hard rules: - 3+ files changed -> MUST be 2+ commits - 5+ files changed -> MUST be 3+ commits - 10+ files changed -> MUST be 5+ commits ## Style Detection (First Step) Before committing, analyze the last 30 commits: ```bash git log -30 --oneline git log -30 --pretty=format:"%s" ``` Detect: - **Language**: Korean vs English (use majority) - **Style**: SEMANTIC (feat:, fix:) vs PLAIN vs SHORT ## Commit Splitting Rules | Criterion | Action | |-----------|--------| | Different directories/modules | SPLIT | | Different component types | SPLIT | | Can be reverted independently | SPLIT | | Different concerns (UI/logic/config/test) | SPLIT | | New file vs modification | SPLIT | ## History Search Commands | Goal | Command | |------|---------| | When was "X" added? | `git log -S "X" --oneline` | | What commits touched "X"? | `git log -G "X" --oneline` | | Who wrote line N? | `git blame -L N,N file.py` | | When did bug start? | `git bisect start && git bisect bad && git bisect good <tag>` | ## Rebase Safety - **NEVER** rebase main/master - Use `--force-with-lease` (never `--force`) - Stash dirty files before rebasing

评论 0

还没有评论,来抢沙发。