commit-changes

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

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