commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate a git commit for the current changes using a concise Conventional Commits-style subject.
使用简洁的Conventional Commits风格的主题,为当前变更创建Git提交。
Format
格式
<type>(<scope>): <summary>- REQUIRED. Use
typefor new features,featfor bug fixes. Other common types:fix,docs,refactor,chore,test.perf - OPTIONAL. Short noun in parentheses for the affected area (e.g.,
scope,api,parser).ui - REQUIRED. Short, imperative, <= 72 chars, no trailing period.
summary
<type>(<scope>): <summary>- 必填。新增功能用
type,修复bug用feat。其他常见类型:fix(文档)、docs(重构)、refactor(杂项)、chore(测试)、test(性能优化)。perf - 可选。用括号包裹的简短名词,表示受影响的区域(例如
scope、api、parser)。ui - 必填。简短、祈使语气、不超过72个字符,结尾无句号。
summary
Notes
注意事项
- Body is OPTIONAL. If needed, add a blank line after the subject and write short paragraphs.
- Do NOT include breaking-change markers or footers.
- Do NOT add sign-offs (no ).
Signed-off-by - Only commit; do NOT push.
- If it is unclear whether a file should be included, ask the user which files to commit.
- Treat any caller-provided arguments as additional commit guidance. Common patterns:
- Freeform instructions should influence scope, summary, and body.
- File paths or globs should limit which files to commit. If files are specified, only stage/commit those unless the user explicitly asks otherwise.
- If arguments combine files and instructions, honor both.
- 正文(Body)可选。如果需要,在主题后添加空行,然后撰写简短段落。
- 请勿包含破坏性变更标记或页脚。
- 请勿添加签名(不要)。
Signed-off-by - 仅执行提交操作;请勿推送(push)。
- 如果不确定是否应包含某个文件,请询问用户要提交哪些文件。
- 将调用者提供的任何参数视为额外的提交指导。常见模式:
- 自由格式的说明应影响范围、主题和正文。
- 文件路径或通配符应限制要提交的文件。如果指定了文件,除非用户明确要求,否则仅暂存/提交这些文件。
- 如果参数同时包含文件和说明,请同时遵循两者。
Steps
步骤
- Infer from the prompt if the user provided specific file paths/globs and/or additional instructions.
- Review and
git statusto understand the current changes (limit to argument-specified files if provided).git diff - (Optional) Run to see commonly used scopes.
git log -n 50 --pretty=format:%s - If there are ambiguous extra files, ask the user for clarification before committing.
- Stage only the intended files (all changes if no files specified).
- Run (and
git commit -m "<subject>"if needed).-m "<body>"
- 从提示信息中推断用户是否提供了特定的文件路径/通配符和/或额外说明。
- 查看和
git status以了解当前变更(如果提供了参数指定的文件,则仅限这些文件)。git diff - (可选)运行查看常用的范围(scope)。
git log -n 50 --pretty=format:%s - 如果存在模糊的额外文件,请在提交前询问用户以明确。
- 仅暂存目标文件(如果未指定文件,则暂存所有变更)。
- 运行(如果需要,添加
git commit -m "<subject>")。-m "<body>"