git-commit-helper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Commit Helper

Git Commit Helper

用于提交代码到 git 仓库,使用 commit message。
你需要自带判断当前项目的主要语言,并根据语言习惯生成合适的 commit message。
This tool is used to submit code to a Git repository and generate appropriate commit messages.
You need to automatically determine the main language of the current project and generate suitable commit messages according to language conventions.

提交信息格式

Commit Message Format

提交信息应遵循 Conventional Commits 规范:
<类型>: <简短描述>

[可选的正文]

[可选的脚注]
Commit messages should follow the Conventional Commits specification:
<type>: <short description>

[optional body]

[optional footer]

类型说明

Type Explanation

类型说明Emoji
feat
新功能
fix
修复 bug🐛
docs
文档更新📝
style
代码格式调整💄
refactor
代码重构♻️
perf
性能优化
test
测试相关
chore
构建/工具变动🔧
ci
CI/CD 配置👷
revert
回滚提交
TypeDescriptionEmoji
feat
New feature
fix
Fix bug🐛
docs
Documentation update📝
style
Code format adjustment💄
refactor
Code refactoring♻️
perf
Performance optimization
test
Test-related changes
chore
Build/tooling changes🔧
ci
CI/CD configuration changes👷
revert
Revert a commit

示例

Examples

/commit ✨ feat: 新增用户登录功能
/commit 🐛 fix: 修复密码重置接口的空指针异常
/commit 📝 docs: 更新 README.md 安装说明
/commit ♻️ refactor: 重构用户管理模块代码结构
/commit ✨ feat: Add user login functionality
/commit 🐛 fix: Fix null pointer exception in password reset API
/commit 📝 docs: Update installation instructions in README.md
/commit ♻️ refactor: Restructure user management module code

提交流程

Submission Process

  1. 检查 git 状态
  2. 显示变更文件列表
  3. 自动执行
    git commit
    提交代码
  4. 显示提交结果
  5. 询问用户:是否执行
    git push
    将提交推送到远程仓库
  1. Check Git status
  2. Display the list of changed files
  3. Automatically execute
    git commit
    to submit code
  4. Display submission results
  5. Ask the user: Whether to execute
    git push
    to push the commit to the remote repository

注意事项

Notes

  • 提交前自动检查是否有未暂存的修改
  • 如有多个不相关的修改,建议分批提交
  • 提交信息应简洁明了,首行不超过 50 个字符
  • Automatically check for unstaged changes before submission
  • If there are multiple unrelated changes, it is recommended to submit them in batches
  • Commit messages should be concise and clear, with the first line not exceeding 50 characters