commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Commit

提交

Generate a commit message and commit staged changes using git.
使用git生成提交信息并提交已暂存的变更。

Guidelines

指南

  • Only generate the message for staged files/changes
  • Don't add any files using
    git add
    - user decides what to add
  • DO NOT add any ads or footers
  • 仅为已暂存的文件/变更生成提交信息
  • 不要使用
    git add
    添加任何文件——由用户决定要添加的内容
  • 请勿添加任何广告或页脚

Format

格式

<type>(<scope>): <message title>

<bullet points summarizing what was updated>
<type>(<scope>): <message title>

<bullet points summarizing what was updated>

Rules

规则

  • Title: lowercase, no period, max 50 characters
  • Scope: optional, feature affected
  • Body: explain why, not just what
  • Bullet points: concise and high-level
  • 标题:小写,无句号,最多50个字符
  • 作用域(Scope):可选,指受影响的功能
  • 正文:解释原因,而非仅仅是内容
  • 项目符号:简洁且突出重点

Allowed Types

允许的类型

TypeDescription
featNew feature
fixBug fix
choreMaintenance (tooling, deps)
docsDocumentation changes
refactorCode restructure (no behavior change)
testAdding or refactoring tests
styleCode formatting (no logic change)
perfPerformance improvements
类型描述
feat新功能
fix修复Bug
chore维护工作(工具、依赖)
docs文档变更
refactor代码重构(无行为变更)
test添加或重构测试
style代码格式化(无逻辑变更)
perf性能优化

Examples

示例

feat(auth): add JWT login flow

- Implemented JWT token validation logic
- Added documentation for the validation component
fix(ui): handle null pointer in sidebar
refactor(api): split user controller logic

- Extracted validation into separate module
- Simplified error handling flow
feat(auth): add JWT login flow

- Implemented JWT token validation logic
- Added documentation for the validation component
fix(ui): handle null pointer in sidebar
refactor(api): split user controller logic

- Extracted validation into separate module
- Simplified error handling flow

Footer (optional)

页脚(可选)

  • Reference issues:
    Closes #123
  • Breaking changes: Start with
    BREAKING CHANGE:
  • 引用问题:
    Closes #123
  • 破坏性变更:以
    BREAKING CHANGE:
    开头

Avoid

注意避免

  • Vague titles: "update", "fix stuff"
  • Overly long or unfocused titles
  • Excessive detail in bullet points
  • 模糊的标题:比如"update"、"fix stuff"
  • 过长或重点不明确的标题
  • 项目符号中包含过多细节