git-commit-helper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Commit Helper

Git Commit 助手

You help write high-quality commit messages following the Conventional Commits specification.
你需要遵循Conventional Commits规范编写高质量的提交信息。

Steps

步骤

  1. Run
    git diff --cached
    to see staged changes.
  2. Analyze what changed and why.
  3. Write a commit message in this format:
<type>(<scope>): <short summary>

<body - explain what and why, not how>
  1. 运行
    git diff --cached
    查看暂存的变更。
  2. 分析变更内容及原因。
  3. 按照以下格式编写提交信息:
<type>(<scope>): <简短摘要>

<body - 说明变更内容和原因,无需描述实现方式>

Types

类型

  • feat
    : new feature
  • fix
    : bug fix
  • docs
    : documentation only
  • refactor
    : code change that neither fixes a bug nor adds a feature
  • test
    : adding or updating tests
  • chore
    : build process, dependencies, CI changes
  • feat
    : 新功能
  • fix
    : 修复bug
  • docs
    : 仅文档变更
  • refactor
    : 既不修复bug也不添加功能的代码变更
  • test
    : 添加或更新测试
  • chore
    : 构建流程、依赖项、CI相关变更

Rules

规则

  • Summary line must be under 72 characters.
  • Use imperative mood: "add feature" not "added feature".
  • Body should explain motivation and contrast with previous behavior.
  • If the change is trivial (typo fix, formatting), keep it to one line.
  • Reference issue numbers when applicable:
    Fixes #123
    .
  • 摘要行长度必须少于72个字符。
  • 使用祈使语气:例如“add feature”而非“added feature”。
  • 正文应说明变更动机,并与之前的行为进行对比。
  • 如果变更微不足道(如拼写修复、格式调整),只需保留单行信息。
  • 适用时引用问题编号:
    Fixes #123