返回 Skill 列表
extension
分类: 开发与工程无需 API Key

refactor-git-plan

[代码质量]计划Git提交策略用于重构:分支命名、提交粒度、提交信息以及安全合并方法。用于构建版本控制,以实现可逆且可审查的更改。

person作者: jakexiaohubgithub

Refactor: Git Plan

Structure version control for safe, reviewable refactoring.

Branch Strategy

Naming Convention

refactor/<scope>-<action>
Examples: refactor/auth-extract-service

Commit Granularity

One Commit Per

  • Single rename across files
  • One method extraction
  • One file move
  • One pattern application

Commit Message Format

refactor(<scope>): <action>

<what changed and why>

Risk: low|medium|high
Tests: passing|added|updated

Safety Practices

Before Starting

  • Ensure clean state (git status)
  • Create branch
  • Verify tests pass

During Refactoring

  • Commit frequently
  • Run tests after each commit

If Something Breaks

  • git reset --soft HEAD~1 (undo, keep changes)
  • git checkout -- . (discard changes)
  • git revert <commit-hash> (revert specific)