git-committer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGenerating a git commit message
生成Git提交信息
Instructions
操作步骤
- Run ,
git status --short, andgit diffto gather current changes, including untracked filesgit diff --staged - If there are staged files, generate commit message suggestions using only staged changes (including staged newly added files)
- If there are no staged files, include unstaged diff changes and untracked files in the suggestion context
- For untracked files, inspect file names and content (for example with and
git status --short/cat) so they are represented in the suggested messagesed - For more context, get the last 5 to 10 commit messages as well
- Suggest a commit message:
- The commit message should be a single line
- The commit message should be a summary of the changes
- The commit message should follow conventional commit conventions
- If there too many changes, suggest multiple commit messages with a split of files between each commit message
- 运行、
git status --short和git diff命令,收集当前的变更内容,包括未跟踪文件git diff --staged - 如果存在已暂存文件,仅基于已暂存变更(包括已暂存的新增文件)生成提交信息建议
- 如果没有已暂存文件,则在建议的上下文内容中包含未暂存的diff变更和未跟踪文件
- 对于未跟踪文件,查看文件名和内容(例如使用和
git status --short/cat命令),以便在建议的提交信息中体现这些文件sed - 为获取更多上下文,同时获取最近5到10条提交信息
- 生成提交信息建议:
- 提交信息应为单行格式
- 提交信息应是变更内容的总结
- 提交信息需遵循Conventional Commits规范
- 如果变更内容过多,建议拆分生成多条提交信息,每条对应一部分文件
Best practices
最佳实践
- Use present tense
- After the tag (e.g. ), the first letter should be capitalized, unless it's a symbol like a function name
feat:
- 使用现在时态
- 在标签(例如)之后,首字母应大写,除非是函数名这类符号
feat: