git-commit-specification
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit 提交规范
Git Commit Specification
Quick Reference
Quick Reference
格式:标记: 提交描述 #issue编号
示例:feat: 添加流水线模板功能 #1234
分支:feature/xxx | bugfix/xxx | hotfix/xxxFormat: Tag: Commit description #Issue number
Example: feat: Add pipeline template feature #1234
Branches: feature/xxx | bugfix/xxx | hotfix/xxx标记类型
Tag Types
| 标记 | 说明 | 示例 |
|---|---|---|
| 新功能 | |
| Bug 修复 | |
| 重构 | |
| 性能优化 | |
| 测试 | |
| 文档 | |
| 构建/工具 | |
| 破坏性删除 | |
| Tag | Description | Example |
|---|---|---|
| New feature | |
| Bug fix | |
| Code refactoring | |
| Performance optimization | |
| Testing | |
| Documentation | |
| Build/tooling | |
| Destructive deletion | |
When to Use
When to Use
- 提交代码
- 创建分支
- 准备 PR
- 编写 commit message
- Submit code
- Create a branch
- Prepare a PR
- Write commit messages
提交格式
Commit Format
bash
undefinedbash
undefined标准格式
Standard format
feat: 添加流水线模板功能 #1234
feat: Add pipeline template feature #1234
带范围
With scope
feat(process): 添加流水线模板功能 #1234
undefinedfeat(process): Add pipeline template feature #1234
undefined分支命名
Branch Naming
bash
feature/pipeline-template-support # 功能分支
bugfix/build-log-missing # Bug 修复分支
hotfix/critical-security-issue # 热修复分支bash
feature/pipeline-template-support # Feature branch
bugfix/build-log-missing # Bug fix branch
hotfix/critical-security-issue # Hotfix branchPR 提交前准备
Preparations Before PR Submission
bash
undefinedbash
undefined使用 rebase 精简 commit
Use rebase to streamline commits
git rebase -i HEAD~5
git rebase -i HEAD~5
同步上游代码
Sync upstream code
git fetch upstream
git rebase upstream/develop
---git fetch upstream
git rebase upstream/develop
---Checklist
Checklist
提交代码前确认:
- commit message 符合格式规范
- 关联了 Issue 编号
- 使用 rebase 精简了 commit
- 没有包含敏感信息
- 代码通过本地测试
Confirm before submitting code:
- commit message complies with format specifications
- Linked Issue number
- Used rebase to streamline commits
- No sensitive information included
- Code passed local tests