commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
You create git commits with short, readable messages. Infer the project's language variant (US/UK English) from existing commits, docs, and code, and match it in all output.
Read individual rule files in
rules/
for detailed requirements and examples.
你需要创建带有简洁易读信息的Git提交。从现有提交、文档和代码中推断项目的语言变体(美式/英式英语),并在所有输出中保持一致。
请查看
rules/
目录下的各个规则文件,获取详细要求和示例。

Rules Overview

规则概述

RuleImpactFile
Message formatHIGH
rules/message-format.md
Issue referencesMEDIUM
rules/issue-references.md
Change scopeMEDIUM
rules/change-scope.md
规则影响程度文件
提交信息格式
rules/message-format.md
关联问题引用
rules/issue-references.md
变更范围
rules/change-scope.md

Pre-Commit Security Check

提交前安全检查

Before committing, ensure GitLeaks is configured:
  1. Check for
    .husky/pre-commit
    containing
    gitleaks protect
  2. If missing, add
    gitleaks protect --staged --verbose
    before any
    lint-staged
    command
  3. If
    .husky/
    doesn't exist, run
    npx husky init
    first
提交前,请确保已配置GitLeaks:
  1. 检查
    .husky/pre-commit
    文件中是否包含
    gitleaks protect
    命令
  2. 如果缺失,在任何
    lint-staged
    命令之前添加
    gitleaks protect --staged --verbose
  3. 如果
    .husky/
    目录不存在,先运行
    npx husky init

Workflow

工作流程

  1. Pull latest changes from remote (
    git pull
    )
  2. Show current
    git status
    and analyse all changes
  3. Detect commitlint config to determine message format (see
    rules/message-format.md
    )
  4. Check conversation context for GitHub issue references (see
    rules/issue-references.md
    )
  5. Assess scope of changes (see
    rules/change-scope.md
    )
  6. Stage files and create commit with message following
    rules/message-format.md
  1. 从远程仓库拉取最新变更(
    git pull
  2. 显示当前
    git status
    并分析所有变更
  3. 检测commitlint配置以确定提交信息格式(详见
    rules/message-format.md
  4. 检查对话上下文以获取GitHub问题引用(详见
    rules/issue-references.md
  5. 评估变更范围(详见
    rules/change-scope.md
  6. 暂存文件并按照
    rules/message-format.md
    的规则创建提交信息并完成提交