commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSentry Commit Messages
Sentry 提交消息
Before Committing
提交前
bash
git branch --show-currentIf the branch is or , create a feature branch unless the user
explicitly requested a direct commit. Re-check the branch and stop if it is
still or .
mainmastermainmasterCommit one coherent, independently reviewable change at a time.
bash
git branch --show-current如果分支是或,除非用户明确要求直接提交,否则创建一个功能分支。重新检查分支,如果仍然是或则停止操作。
mainmastermainmaster每次提交一个连贯、可独立评审的变更。
Message Rules
消息规则
Use:
text
<type>(<scope>): <subject>
<optional body>
<optional footer>- Scope is optional. Add before
!for a breaking change.: - Write the subject in imperative, present tense; capitalize it, omit the trailing period, and keep it at 70 characters or fewer.
- Keep every line under 100 characters.
- Use the body only when useful. Explain what changed and why, including previous behavior or motivation when it helps.
- Never include customer or organization names, user emails, support ticket contents, secrets, or PII. Describe the technical symptom instead.
Allowed types: , , , , , , ,
, , , , , and .
featfixrefperfdocstestbuildcichorestylemetalicenserevertUse for refactoring without behavior changes, for formatting
without logic changes, and for repository metadata.
refstylemeta使用以下格式:
text
<type>(<scope>): <subject>
<可选正文>
<可选页脚>- Scope(范围)是可选的。如果是破坏性变更,在前添加
:。! - 主题(subject)使用祈使语气、现在时态;首字母大写,省略句尾句号,长度控制在70字符以内。
- 每行内容保持在100字符以内。
- 仅在有用时使用正文部分。解释变更内容和原因,必要时说明之前的行为或动机。
- 绝对不要包含客户或组织名称、用户邮箱、支持工单内容、密钥或个人身份信息(PII)。改为描述技术症状。
允许的类型:、、、、、、、、、、、和。
featfixrefperfdocstestbuildcichorestylemetalicenserevert使用表示无行为变更的重构,表示无逻辑变更的格式调整,表示仓库元数据相关变更。
refstylemetaFooters
页脚
- closes an issue when merged.
Fixes <issue> - links an issue without closing it.
Refs <issue> - For breaking changes, add .
BREAKING CHANGE: <impact>
- 在合并时关闭对应的问题。
Fixes <issue> - 链接问题但不关闭它。
Refs <issue> - 对于破坏性变更,添加。
BREAKING CHANGE: <impact>
Creating the Commit
创建提交
Use separate arguments for paragraphs and footers. Never put literal
sequences in a commit message or open an interactive editor.
-m\nbash
git commit -m "fix(api): Handle null response in user endpoint" \
-m "Return 404 when the user API finds a deleted account." \
-m "Fixes SENTRY-5678"使用单独的参数来区分段落和页脚。不要在提交消息中使用字面意义的序列,也不要打开交互式编辑器。
-m\nbash
git commit -m "fix(api): Handle null response in user endpoint" \
-m "Return 404 when the user API finds a deleted account." \
-m "Fixes SENTRY-5678"