commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecommit
Commit
执行标准化的 Git 提交流程,确保提交历史符合 Conventional Commit Messages。
Execute a standardized Git commit workflow to ensure commit history complies with Conventional Commit Messages.
工作流程
Workflow
- 分析更改: 运行 和
git status识别改动逻辑。git diff - 逻辑分组: 将不同功能或模块的更改拆分为独立的提交,严禁一次性提交不相关的改动。
- 生成消息: 为每组更改生成全英文的规范消息。
- 自动执行: 按顺序执行 (或特定文件) 和
git add .。git commit -m "<message>" - 安全推送: 完成所有本地提交后,执行 。
git push
- Analyze Changes: Run and
git statusto identify the logic of changes.git diff - Logical Grouping: Split changes for different features or modules into independent commits. Never submit unrelated changes in one single commit.
- Generate Message: Create a standardized, English-only commit message for each group of changes.
- Execute Automatically: Run (or specific files) and
git add .in sequence.git commit -m "<message>" - Safe Push: Execute after completing all local commits.
git push
消息规范
Message Standards
- 语言: 必须使用英文 (English)。
- 格式:
<type>(<scope>): <subject>- Type: 必须从以下范围选择:
- : New feature
feat - : Bug fix
fix - : Documentation only changes
docs - : Changes that do not affect the meaning of the code (white-space, formatting, etc)
style - : A code change that neither fixes a bug nor adds a feature
refactor - : A code change that improves performance
perf - : Adding missing tests or correcting existing tests
test - : Changes to the build process or auxiliary tools and libraries
chore
- Scope: 可选,小写英文,指出改动范围(如:auth, parser, user-api)。
- Subject:
- 使用祈使句(Imperative mood),首字母不要大写。
- 结尾不要加句号 。
. - 简洁明了,控制在 50 字符以内。
- Type: 必须从以下范围选择:
- Language: Must use English.
- Format:
<type>(<scope>): <subject>- Type: Must be selected from the following options:
- : New feature
feat - : Bug fix
fix - : Documentation only changes
docs - : Changes that do not affect the meaning of the code (white-space, formatting, etc)
style - : A code change that neither fixes a bug nor adds a feature
refactor - : A code change that improves performance
perf - : Adding missing tests or correcting existing tests
test - : Changes to the build process or auxiliary tools and libraries
chore
- Scope: Optional, lowercase English, indicating the scope of changes (e.g., auth, parser, user-api).
- Subject:
- Use imperative mood, do not capitalize the first letter.
- Do not add a period at the end.
. - Be concise and clear, keep it within 50 characters.
- Type: Must be selected from the following options:
约束规则
Constraints
- 严禁使用 Emoji: 保持纯文本格式。
- 严禁 Force Push: 确保远程分支安全。
- 单行模式: 消息必须是单行,严禁换行或正文描述。
- No Emojis Allowed: Keep the message in plain text format.
- No Force Push Allowed: Ensure the safety of remote branches.
- Single-line Mode: The message must be a single line, no line breaks or body descriptions allowed.
示例
Examples
feat(auth): add google oauth2 supportfix(db): resolve connection leak in productionrefactor(utils): simplify date format logic
feat(auth): add google oauth2 supportfix(db): resolve connection leak in productionrefactor(utils): simplify date format logic