commit-changes
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen committing changes, follow this workflow:
-
Analyze the workspace: Runand
git status(staged and unstaged) to understand all changes.git diff -
Group changes semantically: Identify logical units of work. Each commit must be atomic — one functional change per commit. Group related files that together implement a single concern.
-
Write conventional commit messages: Use the formatwithout a body. Allowed types:
<type>(<scope>): <description>- : new feature
feat - : bug fix
fix - : code restructuring without behavior change
refactor - : documentation only
docs - : formatting, whitespace, semicolons (no logic change)
style - : adding or updating tests
test - : tooling, configs, dependencies
chore - : performance improvement
perf - : CI/CD changes
ci - : build system changes
build - : reverting a previous commit
revert
-
Commit rules:
- One-line messages only — never use a commit body.
- Never include ,
Co-authored-by, or any author metadata.Authored-by - Use for specific files per commit, never
git addunless all changes belong to one commit.git add . - Run after each commit to verify success.
git status
-
Execution order: Stage and commit one group at a time. Do not skip ahead.
提交更改时,请遵循以下工作流程:
-
分析工作区:运行和
git status(包括暂存和未暂存文件)以了解所有更改。git diff -
按语义分组更改:识别逻辑工作单元。每个提交必须是原子性的——每个提交对应一项功能更改。将共同实现单一目标的相关文件归为一组。
-
编写约定式提交信息:使用格式,无需正文。允许的类型包括:
<type>(<scope>): <description>- : 新功能
feat - : 修复bug
fix - : 代码重构(不改变行为)
refactor - : 仅修改文档
docs - : 格式调整、空白字符、分号修改(无逻辑变化)
style - : 添加或更新测试
test - : 工具配置、依赖项更新
chore - : 性能优化
perf - : CI/CD相关更改
ci - : 构建系统更改
build - : 回滚之前的提交
revert
-
提交规则:
- 仅使用单行提交信息——绝不使用提交正文。
- 绝不包含、
Co-authored-by或任何作者元数据。Authored-by - 每次提交使用添加特定文件,除非所有更改都属于同一提交,否则绝不使用
git add。git add . - 每次提交后运行以验证提交成功。
git status
-
执行顺序:一次暂存并提交一组更改。请勿跳过步骤。