Files
vibe_coding/.cursor/rules/020-git.mdc
2026-03-05 21:27:11 +08:00

44 lines
1001 B
Plaintext

---
description: "Git 与版本控制规范 — 分支/提交/PR 策略"
alwaysApply: false
---
# 📦 Git Standards
## 分支命名
```
feature/TICKET-短描述
bugfix/TICKET-短描述
hotfix/TICKET-短描述
chore/短描述
```
## Commit 规范 (Conventional Commits)
```
type(scope): description
feat(auth): add OAuth login with Google
fix(api): handle null response from payment gateway
refactor(db): optimize user query with index
test(auth): add unit tests for JWT validation
docs(readme): update setup instructions
chore(deps): upgrade next to 15.1
```
Types: `feat` `fix` `refactor` `test` `docs` `chore` `style` `perf` `ci` `build`
## PR 规范
- 标题符合 Conventional Commits
- 描述包含: 改了什么 / 为什么改 / 如何测试
- 单个 PR 不超过 400 行变更
- 必须有关联 Issue/Ticket
## Git 操作安全
- commit 前运行 `npm run lint`(前端)或 `composer analyse`(后端)
- 禁止 force push 到 main/master/develop
- 合并冲突需人工介入