git

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Conventional Commits

Git Conventional Commits

Standardized commit message format for clean git history.
用于打造清晰Git历史的标准化提交信息格式。

Instructions

使用说明

1. Commit Format

1. 提交格式

<type>(<scope>): <description>

[optional body]

[optional footer(s)]
<type>(<scope>): <description>

[optional body]

[optional footer(s)]

2. Commit Types

2. 提交类型

TypeDescriptionExample
feat
New feature
feat(auth): add login form
fix
Bug fix
fix(api): handle null response
docs
Documentation
docs: update README
style
Formatting
style: fix indentation
refactor
Code restructure
refactor(utils): simplify logic
perf
Performance
perf: optimize image loading
test
Tests
test: add unit tests for auth
build
Build system
build: update dependencies
ci
CI/CD
ci: add GitHub Actions
chore
Maintenance
chore: clean up old files
类型说明示例
feat
新增功能
feat(auth): add login form
fix
修复Bug
fix(api): handle null response
docs
文档更新
docs: update README
style
代码格式调整
style: fix indentation
refactor
代码重构
refactor(utils): simplify logic
perf
性能优化
perf: optimize image loading
test
测试相关
test: add unit tests for auth
build
构建系统调整
build: update dependencies
ci
CI/CD配置
ci: add GitHub Actions
chore
日常维护
chore: clean up old files

3. Scope (Optional)

3. 作用域(可选)

Scope indicates the affected area:
feat(auth): add OAuth support
fix(cart): correct total calculation
refactor(api): restructure endpoints
作用域用于标识受影响的代码区域:
feat(auth): add OAuth support
fix(cart): correct total calculation
refactor(api): restructure endpoints

4. Breaking Changes

4. 破坏性变更

feat(api)!: change response format

BREAKING CHANGE: API response now uses camelCase keys
feat(api)!: change response format

BREAKING CHANGE: API response now uses camelCase keys

5. Examples

5. 示例

bash
undefined
bash
undefined

✅ Good

✅ 规范示例

feat(user): add profile picture upload fix(checkout): resolve payment validation error docs(api): add authentication endpoints refactor(components): extract common button styles
feat(user): add profile picture upload fix(checkout): resolve payment validation error docs(api): add authentication endpoints refactor(components): extract common button styles

❌ Bad

❌ 不规范示例

update code fixed bug WIP misc changes
undefined
update code fixed bug WIP misc changes
undefined

6. Multi-line Commits

6. 多行提交信息

feat(dashboard): add analytics widget

- Add chart component for daily stats
- Integrate with analytics API
- Add loading skeleton

Closes #123
feat(dashboard): add analytics widget

- Add chart component for daily stats
- Integrate with analytics API
- Add loading skeleton

Closes #123

References

参考链接