commit-helper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Commit Helper

提交信息助手

Generate well-structured commit messages following conventional commit format.
生成符合Conventional Commit格式的结构化提交信息。

Instructions

使用说明

  1. Run
    git diff --staged
    to see staged changes
  2. Analyze the changes to understand:
    • What files were modified
    • What type of change (feat, fix, refactor, docs, etc.)
    • The scope/component affected
  3. Generate a commit message with:
    • Summary line under 50 characters
    • Type prefix (feat, fix, docs, refactor, test, chore)
    • Optional scope in parentheses
    • Detailed body explaining what and why
  1. 运行
    git diff --staged
    查看暂存的变更
  2. 分析变更以明确:
    • 哪些文件被修改
    • 变更类型(feat、fix、refactor、docs等)
    • 受影响的范围/组件
  3. 生成包含以下内容的提交信息:
    • 不超过50个字符的摘要行
    • 类型前缀(feat、fix、docs、refactor、test、chore)
    • 可选的括号内的范围
    • 解释变更内容和原因的详细正文

Commit Types

提交类型

  • feat
    : New feature
  • fix
    : Bug fix
  • docs
    : Documentation changes
  • refactor
    : Code restructuring without behavior change
  • test
    : Adding or updating tests
  • chore
    : Maintenance tasks
  • feat
    : 新功能
  • fix
    : 修复Bug
  • docs
    : 文档变更
  • refactor
    : 代码重构(无行为变化)
  • test
    : 添加或更新测试
  • chore
    : 维护任务

Best Practices

最佳实践

  • Use present tense ("Add feature" not "Added feature")
  • Explain what and why, not how
  • Keep summary concise but descriptive
  • Reference issue numbers when applicable
  • 使用现在时态(例如“Add feature”而非“Added feature”)
  • 解释做了什么以及为什么这么做,而非如何实现
  • 摘要简洁且具有描述性
  • 适用时引用问题编号

Example Output

示例输出

feat(auth): add OAuth2 support for GitHub login

- Implement OAuth2 flow with PKCE
- Add token refresh mechanism
- Store tokens securely in encrypted storage

Closes #123
feat(auth): add OAuth2 support for GitHub login

- Implement OAuth2 flow with PKCE
- Add token refresh mechanism
- Store tokens securely in encrypted storage

Closes #123