commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sentry Commit Messages

Sentry 提交消息

Before Committing

提交前

bash
git branch --show-current
If the branch is
main
or
master
, create a feature branch unless the user explicitly requested a direct commit. Re-check the branch and stop if it is still
main
or
master
.
Commit one coherent, independently reviewable change at a time.
bash
git branch --show-current
如果分支是
main
或
master
,除非用户明确要求直接提交,否则创建一个功能分支。重新检查分支,如果仍然是
main
或
master
则停止操作。
每次提交一个连贯、可独立评审的变更。

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:
feat
,
fix
,
ref
,
perf
,
docs
,
test
,
build
,
ci
,
chore
,
style
,
meta
,
license
, and
revert
.
Use
ref
for refactoring without behavior changes,
style
for formatting without logic changes, and
meta
for repository metadata.
使用以下格式:
text
<type>(<scope>): <subject>

<可选正文>

<可选页脚>
  • Scope(范围)是可选的。如果是破坏性变更,在
    :
    前添加
    !
    。
  • 主题(subject)使用祈使语气、现在时态;首字母大写,省略句尾句号,长度控制在70字符以内。
  • 每行内容保持在100字符以内。
  • 仅在有用时使用正文部分。解释变更内容和原因,必要时说明之前的行为或动机。
  • 绝对不要包含客户或组织名称、用户邮箱、支持工单内容、密钥或个人身份信息(PII)。改为描述技术症状。
允许的类型:
feat
、
fix
、
ref
、
perf
、
docs
、
test
、
build
、
ci
、
chore
、
style
、
meta
、
license
和
revert
。
使用
ref
表示无行为变更的重构,
style
表示无逻辑变更的格式调整,
meta
表示仓库元数据相关变更。

Footers

页脚

  • Fixes <issue>
    closes an issue when merged.
  • Refs <issue>
    links an issue without closing it.
  • For breaking changes, add
    BREAKING CHANGE: <impact>
    .
  • Fixes <issue>
    在合并时关闭对应的问题。
  • Refs <issue>
    链接问题但不关闭它。
  • 对于破坏性变更,添加
    BREAKING CHANGE: <impact>
    。

Creating the Commit

创建提交

Use separate
-m
arguments for paragraphs and footers. Never put literal
\n
sequences in a commit message or open an interactive editor.
bash
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
参数来区分段落和页脚。不要在提交消息中使用字面意义的
\n
序列,也不要打开交互式编辑器。
bash
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"