commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCommit
提交
When to use
使用场景
- The current work is ready to record in git
- The diff is understood and intentionally scoped
- 当前工作已准备好记录到git中
- 差异内容已明确,且变更范围是预先规划的
Process
流程
- Inspect ,
git status, andgit diff.git diff --cached - Read recent commit messages so the new commit fits the repo.
- If there is nothing worth committing, stop.
- Stage only the intended files. Never stage secrets.
- Use the user's message if provided. Otherwise write a Conventional Commit message:
- Format:
type(scope): subject - Common types: ,
feat,fix,refactor,test,docschore - Keep the subject short, specific, and in imperative mood
- Use the body for why the change exists, important context, and migrations or follow-up work
- Good examples: ,
feat(auth): add GitHub OAuth loginfix(api): handle empty embedding results
- Format:
- Create the commit and report the hash and message.
- 查看、
git status和git diff。git diff --cached - 阅读近期的提交信息,确保新提交符合仓库的风格。
- 如果没有值得提交的内容,停止操作。
- 仅暂存目标文件,切勿暂存机密信息。
- 如果用户提供了提交信息则使用该信息。否则编写符合Conventional Commit规范的提交信息:
- 格式:
type(scope): subject - 常见类型:、
feat、fix、refactor、test、docschore - 主题部分要简短、具体,且使用祈使语气
- 正文部分说明变更的原因、重要上下文,以及迁移或后续工作
- 优秀示例:、
feat(auth): add GitHub OAuth loginfix(api): handle empty embedding results
- 格式:
- 创建提交并返回提交哈希值和提交信息。
Verification
验证
- The staged changes match the intended scope
- The commit exists
- confirms the expected result
git status
- 暂存的变更与预期范围一致
- 提交已成功创建
- 确认结果符合预期
git status
Rules
规则
- If the change breaks a contract or requires migration, note it clearly in the commit message body.
- If there is nothing to commit or the diff is not understood, stop.
- Prefer staging specific files over broad adds.
- Do not commit , credentials, or keys.
.env - The subject should say what changed. The body should explain why.
- 如果变更破坏了约定或需要迁移,请在提交信息正文中明确说明。
- 如果没有可提交的内容或无法理解差异,停止操作。
- 优先暂存特定文件,而非大范围添加。
- 不要提交文件、凭证或密钥。
.env - 主题部分应说明变更内容,正文部分应解释变更原因。