git-commit-helper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit 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 |
|---|---|---|
| 新功能 | ✨ |
| 修复 bug | 🐛 |
| 文档更新 | 📝 |
| 代码格式调整 | 💄 |
| 代码重构 | ♻️ |
| 性能优化 | ⚡ |
| 测试相关 | ✅ |
| 构建/工具变动 | 🔧 |
| CI/CD 配置 | 👷 |
| 回滚提交 | ⏪ |
| Type | Description | Emoji |
|---|---|---|
| New feature | ✨ |
| Fix bug | 🐛 |
| Documentation update | 📝 |
| Code format adjustment | 💄 |
| Code refactoring | ♻️ |
| Performance optimization | ⚡ |
| Test-related changes | ✅ |
| Build/tooling changes | 🔧 |
| CI/CD configuration changes | 👷 |
| 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
- 检查 git 状态
- 显示变更文件列表
- 自动执行 提交代码
git commit - 显示提交结果
- 询问用户:是否执行 将提交推送到远程仓库
git push
- Check Git status
- Display the list of changed files
- Automatically execute to submit code
git commit - Display submission results
- Ask the user: Whether to execute to push the commit to the remote repository
git push
注意事项
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